chore: Update how file permissions in /home/user are handled #116
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Update the universal developer image Dockerfile to run
chgrp -R 0 /home/user && chmod -R g=u /home/user
after every RUN step that impacts
/home/user
significantly. This has the effect of reducing the udi8 image's size from9.34GB
to6.59GB
(on disk) -- a ~30% decrease.Previously, one of the last steps in the build process was
executing
chgrp
andchmod
on/home
resulted in a new layer in the image with all of the files in/home
copied (due to the overlay filesystem). By setting permissions as we create files (i.e. in the same RUN command that creates them) we avoid this last step exploding image size:Before
After
To enable this, I also had to update the base developer image Dockerfile, as it was previously copying a root-owned .gitconfig to
/home/user
, which meant that it was not possible tochgrp
this file as user 10001. As a result, building the new udi dockerfile directly will not work until the new base developer image is built; for testing you can replace theFROM
directive in the udi8 dockerfile with