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

Add gitutil.WithExec(runWithStandardUmask) to Git invocations #5092

Closed
wants to merge 1 commit into from

Conversation

tianon
Copy link
Member

@tianon tianon commented Jun 26, 2024

This fixes umask bugs while building from a remote Git URL where ADD/COPY'd files end up with 666/777 permissions instead of 644/755.

Fixes #5066
Refs #4106

This fixes umask bugs while building from a remote Git URL where `ADD`/`COPY`'d files end up with `666`/`777` permissions instead of `644`/`755`.

Signed-off-by: Tianon Gravi <admwiggin@gmail.com>
@tianon
Copy link
Member Author

tianon commented Jun 26, 2024

I have hand-verified this with the same methodology as in #5066:

docker buildx create --name foo --driver-opt image=sha256:of-image-built-from-this-change-to-force-a-local-image
$ docker buildx build --builder foo https://github.com/docker-library/mysql.git#319db566ac7fef45c22f3df15ee5e194a7c43259:8.0 --file Dockerfile.debian --load
...
#16 exporting manifest sha256:549830c9f48b8d7d7579707e8900735dbb688dc8842b264ac8d0d4119a8210bc done
#16 exporting config sha256:11f31906f3b47f2f5380059c1e3072d01491cc4050482c8f4eacd2ba519a6b75 done
...
$ docker run --rm sha256:11f31906f3b47f2f5380059c1e3072d01491cc4050482c8f4eacd2ba519a6b75 ls -l /etc/mysql/my.cnf
-rw-r--r-- 1 root root 1080 Jun 26 23:53 /etc/mysql/my.cnf

jedevc
jedevc previously approved these changes Jun 27, 2024
@tonistiigi
Copy link
Member

#5096 looks better

@tonistiigi tonistiigi closed this Jun 27, 2024
@tianon tianon deleted the git-checkout-umask branch June 27, 2024 16:40
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

Successfully merging this pull request may close these issues.

[v0.13+] unexpected permissions on COPY'd files
3 participants