You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently in the onboarding process of a project, in which developers only have been using Linux so far. However, I am using macOS and using one of their podman run commands failed on my machine. After some investigation, we found out, that mounting a volume of the current directory using . for the path was causing the issue. I checked the documentation for the --mount/ -v option and could not find any limitation on relative paths for mounts.
After some more testing, we noticed .. also does not work. Same applies for relative paths to subfolders without a starting point (e.eg: -v subfolder:/path/in/container instead of -v ./subfolder:/path/in/container) or any path starting with .. (e.g.: -v ../sibling:/path/in/container)
Steps to reproduce the issue
Steps to reproduce the issue
run podman run -v .:/var/www/html php:8.0-apache ls from any folder on the host machine
Describe the results you received
the command above exits with the following error: ls: cannot open directory '.': Permission denied
Describe the results you expected
I would have expected to see the output of the ls command
podman info output
host:
arch: arm64buildahVersion: 1.37.2cgroupControllers:
- cpu
- io
- memory
- pidscgroupManager: systemdcgroupVersion: v2conmon:
package: conmon-2.1.10-1.fc40.aarch64path: /usr/bin/conmonversion: 'conmon version 2.1.10, commit: 'cpuUtilization:
idlePercent: 99.86systemPercent: 0.07userPercent: 0.07cpus: 7databaseBackend: sqlitedistribution:
distribution: fedoravariant: coreosversion: "40"eventLogger: journaldfreeLocks: 2046hostname: localhost.localdomainidMappings:
gidmap:
- container_id: 0host_id: 1000size: 1
- container_id: 1host_id: 100000size: 1000000uidmap:
- container_id: 0host_id: 501size: 1
- container_id: 1host_id: 100000size: 1000000kernel: 6.9.12-200.fc40.aarch64linkmode: dynamiclogDriver: journaldmemFree: 1222479872memTotal: 2043703296networkBackend: netavarknetworkBackendInfo:
backend: netavarkdns:
package: aardvark-dns-1.12.1-1.20240819115418474394.main.6.gc2cd0be.fc40.aarch64path: /usr/libexec/podman/aardvark-dnsversion: aardvark-dns 1.13.0-devpackage: netavark-1.12.1-1.20240819170533312370.main.26.g4358fd3.fc40.aarch64path: /usr/libexec/podman/netavarkversion: netavark 1.13.0-devociRuntime:
name: crunpackage: crun-1.16-1.20240813143753154884.main.16.g26c7687.fc40.aarch64path: /usr/bin/crunversion: |- crun version UNKNOWN commit: 158b340ec38e187abee05cbf3f27b40be2b564d0 rundir: /run/user/501/crun spec: 1.0.0 +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +LIBKRUN +WASM:wasmedge +YAJLos: linuxpasta:
executable: /usr/bin/pastapackage: passt-0^20240726.g57a21d2-1.fc40.aarch64version: | pasta 0^20240726.g57a21d2-1.fc40.aarch64-pasta Copyright Red Hat GNU General Public License, version 2 or later <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.remoteSocket:
exists: truepath: /run/user/501/podman/podman.sockrootlessNetworkCmd: pastasecurity:
apparmorEnabled: falsecapabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOTrootless: trueseccompEnabled: trueseccompProfilePath: /usr/share/containers/seccomp.jsonselinuxEnabled: trueserviceIsRemote: trueslirp4netns:
executable: /usr/bin/slirp4netnspackage: slirp4netns-1.2.2-2.fc40.aarch64version: |- slirp4netns version 1.2.2 commit: 0ee2d87523e906518d34a6b423271e4826f71faf libslirp: 4.7.0 SLIRP_CONFIG_VERSION_MAX: 4 libseccomp: 2.5.5swapFree: 0swapTotal: 0uptime: 14h 21m 24.00s (Approximately 0.58 days)variant: v8plugins:
authorization: nulllog:
- k8s-file
- none
- passthrough
- journaldnetwork:
- bridge
- macvlan
- ipvlanvolume:
- localregistries:
search:
- docker.iostore:
configFile: /var/home/core/.config/containers/storage.confcontainerStore:
number: 2paused: 0running: 0stopped: 2graphDriverName: overlaygraphOptions: {}graphRoot: /var/home/core/.local/share/containers/storagegraphRootAllocated: 106769133568graphRootUsed: 5925675008graphStatus:
Backing Filesystem: xfsNative Overlay Diff: "true"Supports d_type: "true"Supports shifting: "false"Supports volatile: "true"Using metacopy: "false"imageCopyTmpDir: /var/tmpimageStore:
number: 16runRoot: /run/user/501/containerstransientStore: falsevolumePath: /var/home/core/.local/share/containers/storage/volumesversion:
APIVersion: 5.2.2Built: 1724198400BuiltTime: Wed Aug 21 02:00:00 2024GitCommit: ""GoVersion: go1.22.6Os: linuxOsArch: linux/arm64Version: 5.2.2
Podman in a container
No
Privileged Or Rootless
None
Upstream Latest Release
Yes
Additional environment details
No response
Additional information
No response
The text was updated successfully, but these errors were encountered:
hello @oklimberg , ive been thinking about this one ... on the one hand, it might be easy enough to normalize the host side input for the volume mount, but that also gave me pause about expectations.
today, podman cannot do dynamic volume mounting. by this, I mean mount some directory on the fly into the podman machine vm. Mounts need to be defined at the time of creation. So in the case of using . as the directory indicator, we could have a potential problem where if . meant /Users/me/somedir then it would work because /Users/me/ is, by default, mounted into the machine; therefore normalizing it would be fine. On the other hand, if you were sitting in /tmp/foobar and passed ., then it would try and find /tmp/foobar on the machine vm which may or may not exist?
if you kind of expected that and are fine with this approach, speak up. I just wanted to verify expecations first ... thank you for the issue submission either way.
To be honest, the main reason for creating this issue was the different behavior on macOS and Linux.
I will have to check the setup of the Linux users, regarding the path within the default user directory mount from your example.
Is this only valid for direct subfolders of the user home, or does this apply to all subfolders?
Issue Description
I am currently in the onboarding process of a project, in which developers only have been using Linux so far. However, I am using macOS and using one of their
podman run
commands failed on my machine. After some investigation, we found out, that mounting a volume of the current directory using.
for the path was causing the issue. I checked the documentation for the--mount
/-v
option and could not find any limitation on relative paths for mounts.After some more testing, we noticed
..
also does not work. Same applies for relative paths to subfolders without a starting point (e.eg:-v subfolder:/path/in/container
instead of-v ./subfolder:/path/in/container
) or any path starting with..
(e.g.:-v ../sibling:/path/in/container
)Steps to reproduce the issue
Steps to reproduce the issue
podman run -v .:/var/www/html php:8.0-apache ls
from any folder on the host machineDescribe the results you received
the command above exits with the following error: ls: cannot open directory '.': Permission denied
Describe the results you expected
I would have expected to see the output of the ls command
podman info output
Podman in a container
No
Privileged Or Rootless
None
Upstream Latest Release
Yes
Additional environment details
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: