Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increasing layer size depending on user/group IDs #15585

Closed
oszi opened this issue Aug 14, 2015 · 4 comments
Closed

Increasing layer size depending on user/group IDs #15585

oszi opened this issue Aug 14, 2015 · 4 comments

Comments

@oszi
Copy link

oszi commented Aug 14, 2015

Description of Problem:

Edit: Not a docker issue.

How reproducible: 100%

Steps to Reproduce:

Build the following Dockerfile:

FROM debian
RUN useradd -md /data --key=UID_MIN=1000 --key=GID_MIN=1000 user

It doesn't seem to matter what base image we use.

Actual Results:

The RUN command results in a 335.1 kB layer. With a UID/GID of 10000 it results in a 3.25 MB layer;
with 30000 it's 9.73 MB; with 60000 it's 19.45 MB.

Expected Results:

I have no idea what's going on... But I'm sure the layer size shouldn't increase like this. 😨

@nalind
Copy link
Contributor

nalind commented Aug 14, 2015

Some (all?) of this appears to be useradd making sure that there's room for the user's entry in /var/log/lastlog and /var/log/faillog. If you use the -l flag when running useradd, does that prevent what you're seeing?

@oszi
Copy link
Author

oszi commented Aug 14, 2015

It does, thanks. That's a weird way to handle auth logs.

Closing because it's not an issue in docker.

@oszi oszi closed this as completed Aug 14, 2015
@drewdogg
Copy link

drewdogg commented Nov 3, 2015

I ran into this same problem but had the docker build fail due to running out of disk space:

$ docker build .
Sending build context to Docker daemon 2.048 kB
Sending build context to Docker daemon
Step 0 : FROM centos:7
 ---> ce20c473cd8a
Step 1 : RUN groupadd -g 213000086 cmnapp
 ---> Running in 8b29d0a916b0
 ---> cf47ae0e6ab3
Removing intermediate container 8b29d0a916b0
Step 2 : RUN useradd -u 213000086 -g cmnapp cmnapp
 ---> Running in 82b41bc5833a
ApplyLayer exit status 1 stdout:  stderr: write /var/log/lastlog: no space left on device
$ 

It now makes sense since I'm using such a big UID. Added '-l' and now it works!

@drewdogg
Copy link

drewdogg commented Nov 3, 2015

Dup of #5419

mdlinville pushed a commit to docker/docs that referenced this issue Jun 2, 2017
Running `useradd` without `--no-log-init` risks triggering a resource exhaustion issue:

    moby/moby#15585
    moby/moby#5419
    golang/go#13548
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants