-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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
Bad permissions on a trusted container, but correct permissions locally #5892
Comments
according to Docker support, it could be related to issue #4068 which is fixed in 0.10. The team plans two improvements:
|
after 6 weeks and many exchanges with [email protected], I can only confirm that the issue still exists with 1.0 (on trusted builds only) : I've retried this morning |
@florentx I've pulled your image and it looks like this problem has been solved. Can you confirm, please? |
I'm having the same issue on didrocks/docker-udtc. See the linked on github Dockerfile. I have no issue on a local build, but I can't even su - user (bad permission on /lib, /usr and multiple sub directories: ls -l /total 68 Dockerfile at: ubuntu/ubuntu-make@f7f7a4d |
* We use the manually created docker image as docker hub creates with the same Dockfile invalid images (moby/moby#5892)
I believe I am also seeing this same issue. My Dockerfile creates a user using When I build the image locally, everything is |
@unclejack I've pulled the image, and I still see the same issue described in #5892 (comment) |
Hello, amazing, I was testing an other Postgres image yesterday and ran into the exact same issue and Google brought me to #5892 so yes I think there is a Docker issue. |
I also have a permission issue with automated build and docker, and wonder if this could be related or not. I'm building a Go image based on Fedora:20 that works perfectly locally (Docker 1.1) but suddenly fails during automated build with a "Permission denied" error:
There's no manual change of ownership for any file or folder that I would know of (maybe during building Go itself). |
I am having this exact same problem now with liftoff/gateone image. Specifically, build bkuy8gznu3xbuq3gqmkiguk. When trying to run Gate One like so:
...I get the following exception:
I had a look inside the container using nsenter and can see the problem is with the directory permissions inside the gateone module:
That's the same permissions mask (d--x--x---) reported @didrocks (except in his case it was /usr and /var which is much worse). This problem does not occur when I build the Dockerfile manually. |
For reference, I tried setting
I'm tempted to just write a script that finds and fixes all these before Gate One starts but that seems like huge overkill for what is obviously a bug in Docker's build system. |
Ran into this problem with trusted builds (https://registry.hub.docker.com/u/tanmaykm/juliabox_dev/) and wasted a ton of effort trying to figure it out before I ran into this report. My Dockerfile creates a user and switches to it before running further commands. The user's home directory ownership is incorrect and files created with some of the commands have incorrect ownership. Added a |
Investigating this a bit, I was wondering why there aren't more folks running into this issue. It seems that it only impacts images that run their services as non-root. Sadly, almost all the public Dockerfiles and images run everything as root which is the opposite of security best-practices. Considering the impact of that I believe this bug should be considered a major security problem. It doesn't bode well for the term, "trusted" that gets attached to these images. |
@unclejack are you looking into this one? |
I am also running into this issue. I found that if I have a Dockerfile that just adds a user, permissions are fine whether I run locally or from a trusted build. But if after I have created the user, I modify the home directory of that user from the Dockerfile, it changes the permissions of the entire home directory to root: Dockerfile1 snippet: RUN (adduser --disabled-password --gecos "" guest && echo "guest:guest"|chpasswd) Dockerfile2 snippet: RUN (adduser --disabled-password --gecos "" guest && echo "guest:guest"|chpasswd) RUN mkdir /home/guest/scripts Fine when run locally. But after the automated build, in the container for Dockerfile1, /home/guest is owned by guest. But in the container for Dockerfile2, /home/guest is owned by root. |
…nce Docker's automated build process doesn't work with non-root users at the moment (see: moby/moby#5892).
I've tested today, and it seems that the Trusted Build machines do not have the fix yet. Thank you |
@florentx The fix is going to be in the next Docker release and that's when the trusted builds will get fixed. |
I've hit a bug where the Unix permissions are wrongly set when the image is built automatically (trusted build) but when I run the build locally (using the same Dockerfile) everything is fine.
How to reproduce:
The directories
base
andpg_multixact
are wrongly owned byroot
when they should be owned bypostgres
.This is the Dockerfile published (https://index.docker.io/u/tinyerp/sandbox-postgresql/):
The last
RUN pg_ctlcluster
instruction starts and stops the PostgreSQL server in order to create a DB user. (I removed thecreateuser -d openerp
while troubleshooting the issue).I'm puzzled why it builds without this error locally, but the image is built wrong on the public registry.
The text was updated successfully, but these errors were encountered: