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

Bind mount has incorrect owner when running command from args #8012

Open
alecthegeek opened this issue Dec 28, 2024 · 0 comments
Open

Bind mount has incorrect owner when running command from args #8012

alecthegeek opened this issue Dec 28, 2024 · 0 comments
Labels
area/volume Access to host volumes from inside the VM or containers kind/bug Something isn't working

Comments

@alecthegeek
Copy link

alecthegeek commented Dec 28, 2024

Actual Behavior

Running ls -ld . had different results when running as "args" to run vs typing into a running container. Like this.

docker container run -i --rm --mount type=bind,src=$PWD,target=/work --workdir=/work --user=$(id -u):$(id -g)  debian:unstable-slim  ls -ld .
drwxr-xr-x   17 root     root           544 Dec 27 10:54 .

However it I just run the container and type the command into the terminal I get the correct result

/work $ ls -ld .
drwxr-xr-x   17 501      dialout        544 Dec 27 10:54 .

(Note: I tested with containerd and also used Alpine and still for the same incorrect result.)

I tested this with Docker Desktop and I get the expected result.

$ docker container run -i --rm --mount type=bind,src=$PWD,target=/work --workdir=/work --user=$(id -u):$(id -g)  debian:unstable-slim  ls -ld .
drwxr-xr-x 17 501 dialout 544 Dec 27 10:54 .

Steps to Reproduce

$ docker container run -i --rm --mount type=bind,src=$PWD,target=/work --workdir=/work --user=$(id -u):$(id -g)  debian:unstable-slim  ls -ld .

Result

drwxr-xr-x   17 root     root           544 Dec 27 10:54 .

Expected Behavior

drwxr-xr-x 17 501 dialout 544 Dec 27 10:54 .

Additional Information

Apple Silicon m1 and Macos 15.2

Rancher Desktop installed via homebrew and up to date. (Removed Rancher to test Docker so I can't get the revision number, but I did update before my last test)

Rancher Desktop Version

Latest

Rancher Desktop K8s Version

N/A

Which container engine are you using?

moby (docker cli)

What operating system are you using?

macOS

Operating System / Build Version

15.2

What CPU architecture are you using?

arm64 (Apple Silicon)

Linux only: what package format did you use to install Rancher Desktop?

None

Windows User Only

No response

@alecthegeek alecthegeek added the kind/bug Something isn't working label Dec 28, 2024
@gunamata gunamata added the area/volume Access to host volumes from inside the VM or containers label Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/volume Access to host volumes from inside the VM or containers kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants