File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
engine/userguide/eng-image Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -513,12 +513,20 @@ parts of your image.
513
513
514
514
If a service can run without privileges, use ` USER ` to change to a non-root
515
515
user. Start by creating the user and group in the ` Dockerfile ` with something
516
- like ` RUN groupadd -r postgres && useradd -r -g postgres postgres ` .
516
+ like ` RUN groupadd -r postgres && useradd --no-log-init - r -g postgres postgres ` .
517
517
518
518
> ** Note** : Users and groups in an image get a non-deterministic
519
519
> UID/GID in that the “next” UID/GID gets assigned regardless of image
520
520
> rebuilds. So, if it’s critical, you should assign an explicit UID/GID.
521
521
522
+ > ** Note** : Due to an [ unresolved bug] ( https://github.com/golang/go/issues/13548 )
523
+ > in the Go archive/tar package's handling of sparse files, attempting to
524
+ > create a user with a sufficiently large UID inside a Docker container can
525
+ > lead to disk exhaustion as ` /var/log/faillog ` in the container layer is
526
+ > filled with NUL (\0) characters. Passing the ` --no-log-init ` flag to
527
+ > useradd works around this issue. The Debian/Ubuntu ` adduser ` wrapper
528
+ > does not support the ` --no-log-init ` flag and should be avoided.
529
+
522
530
You should avoid installing or using ` sudo ` since it has unpredictable TTY and
523
531
signal-forwarding behavior that can cause more problems than it solves. If
524
532
you absolutely need functionality similar to ` sudo ` (e.g., initializing the
You can’t perform that action at this time.
0 commit comments