Permission denied when trying to use the /var/run/docker.sock
file generated by the mac-helper
#14238
Replies: 10 comments 13 replies
-
@baude PTAL |
Beta Was this translation helpful? Give feedback.
-
I have a similar issue on podman 4.0.3 on Mac (m1). This is simulating how testcontainers starts the ryuk container.
Even with
Another more direct way to test it.
podman was setup using:
|
Beta Was this translation helpful? Give feedback.
-
Someone may correct me, but in my recent experience:
Means that you don't have
Is caused by SELinux, see coreos/fedora-coreos-tracker#585 for details. As a proper solution maybe |
Beta Was this translation helpful? Give feedback.
-
According to this accessing @aaronjwhiteside I've had success with both your @rafaelfranca I'm not familiar with VSCode Remote container extension and the Also, I don't believe the |
Beta Was this translation helpful? Give feedback.
-
You do not need to run --privileged you could disable SELinux for the container. podman run --security-opt label:disabled |
Beta Was this translation helpful? Give feedback.
-
I am moving this to discussion, since I do not believe Podman is doing anything incorrect here. |
Beta Was this translation helpful? Give feedback.
-
This is also tracked at microsoft/vscode-remote-release#2881. It seems there are some key differences with podman that make it unusable in the way devcontainers work. |
Beta Was this translation helpful? Give feedback.
-
If you have control over the source of the mount, this should work: podman run -v /run/user/501/podman/podman.sock:/var/run/docker.sock vsc-volume-bootstrap If you do not (e.g. need to the same path on the local and remote host: $ podman machine ssh ls -l /var/run/docker.sock
lrwxrwxrwx. 1 root root 23 Jul 9 09:31 /var/run/docker.sock -> /run/podman/podman.sock
$ podman machine ssh sudo ln -sf /run/user/501/podman/podman.sock /var/run/docker.sock
$ podman machine ssh ls -l /var/run/docker.sock
lrwxrwxrwx. 1 root root 32 Jul 9 09:33 /var/run/docker.sock -> /run/user/501/podman/podman.sock A proper way if your program supports the cat >>~/.ssh/config <<EOF
Host localhost
IdentityFile $(podman machine inspect --format='{{.SSHConfig.IdentityPath}}')
EOF
export DOCKER_HOST="$(podman machine inspect --format='ssh://{{.SSHConfig.RemoteUsername}}@localhost:{{.SSHConfig.Port}}')"
export DOCKER_SOCK="$(podman system info --format='{{.Host.RemoteSocket.Path}}')" Then my goal was to create a $ podman machine ssh cat /sys/fs/cgroup/user.slice/user-501.slice/[email protected]/cgroup.controllers
cpu io memory pids
$ podman machine ssh bash -e <<EOF
printf '[Service]\nDelegate=cpuset\n' | sudo tee /etc/systemd/system/[email protected]/k3d.conf
sudo systemctl daemon-reload
sudo systemctl restart "user@\${UID}"
EOF
$ podman machine ssh cat /sys/fs/cgroup/user.slice/user-501.slice/[email protected]/cgroup.controllers
cpuset cpu io memory pids |
Beta Was this translation helpful? Give feedback.
-
Just my 5 cents: Was also fighting with the podman bugs on macOS and it turned out to do all podman stuff via Parallels takes almost half less resources on Mac, is free and also no such bugs. |
Beta Was this translation helpful? Give feedback.
-
No way to fix this
|
Beta Was this translation helpful? Give feedback.
-
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
When trying to use the VSCode Remote container extension with podman, one of the commands that is executed tries to use the
/var/run/docker.sock
file to mount a volume. That file has different file permission than the original podman socket it is being liked to:This is causing the command to fail with permission denied. I believe that symlink should have the same permissions as the original file.
Steps to reproduce the issue:
podman run -v /var/run/docker.sock:/var/run/docker.sock vsc-volume-bootstrap
with any valid container.Describe the results you received:
Command failed: podman run -d --mount type=volume,src=rails-main-ecb592c6d095efde43d1d0e49d27304d,dst=/workspaces -v /var/run/docker.sock:/var/run/docker.sock vsc-volume-bootstrap sleep infinity
[953 ms] Error: statfs /var/run/docker.sock: permission denied
Describe the results you expected:
Command executed with success
Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:Output of
podman info --debug
:Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)
Yes
Additional environment details (AWS, VirtualBox, physical, etc.):
Beta Was this translation helpful? Give feedback.
All reactions