When running a build with a large UID/GID the build will eventually fail because it runs out of space. This appears to be realated to this upstream moby/docker bug. Specifically when creating a user with useradd the /var/log/lastlog gets huge because it is a sparse file based on UID and docker doesn't appear to handle that correctly. This comment provides a workaround that works for us. While working through this bug, we put in a little effort to clean up the Dockerfile, mostly a bunch of readability items, but also some size reduction by not chown in a separate layer. Our Dockerfile looks like this:
When running a build with a large UID/GID the build will eventually fail because it runs out of space. This appears to be realated to this upstream moby/docker bug. Specifically when creating a user with
useradd
the/var/log/lastlog
gets huge because it is a sparse file based on UID and docker doesn't appear to handle that correctly. This comment provides a workaround that works for us. While working through this bug, we put in a little effort to clean up theDockerfile
, mostly a bunch of readability items, but also some size reduction by not chown in a separate layer. Our Dockerfile looks like this:This should work for this project as well...