-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
WORKDIR changes the an existing folder's ownership to root:root #9387
Comments
This is a known bug in buildah. |
Unfortunately even with that it does not work correctly. I still see that the ownership for /home/myuser is changed to root:root.
|
The image is fine, but there is a new bug in podman causing this. |
@vrothberg looks like your podman workdir change is forcing WORKDIR to be set to root:root. |
Out of curiosity, how can the image content be checked on that detail? |
|
Cool, thanks! |
Currently podman is always chowning the WORKDIR to root:root This PR will return if the WORKDIR already exists. Fixes: containers#9387 Signed-off-by: Daniel J Walsh <[email protected]>
Currently podman is always chowning the WORKDIR to root:root This PR will return if the WORKDIR already exists. Fixes: containers#9387 Signed-off-by: Daniel J Walsh <[email protected]>
Description
I checked the bug reports I found one issue about folder ownership and WORKDIR: containers/buildah#2323. That issue is about USER and WORKDIR, and in this case the folder is pre-created and chowned.
The podman and buildah work differently with WORKDIR than docker. The folder ownership (user:group) changes from my user (12345:12345) to root user (0:0) in case of buildah/podman. For docker the folder ownership does not change.
Steps to reproduce the issue:
The following build command can be used:
Describe the results you received:
Results for buildah/podman:
Results for docker:
Describe the results you expected:
According to https://docs.docker.com/engine/reference/builder/#workdir
So in this case the folder the exists so it should not be re-created or modified.
For buildah/podman:
Expect that the /home/myuser be owned by myuser:mygroup, but because the root:root owns the /home/myuser, then the user myuser cannot access its own home folder.
For docker:
Observe that the /home/myuser has the correct ownership myuser:mygroup. Also myuser can access its own home folder.
Output of
rpm -q buildah
orapt list buildah
:Output of
buildah version
:Output of
podman version
if reporting apodman build
issue:Output of
cat /etc/*release
:Output of
uname -a
:Output of
cat /etc/containers/storage.conf
:The text was updated successfully, but these errors were encountered: