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'm running a podman --rootfs container with a rootfs path that is read-only and I want to be able to make some of the paths inside the container read/write with volumes. The problem is that --volume=/path to give me an anonymous volume that will get cleaned up when the container gets cleaned up isn't working because the copy up to initially populate the volume is failing:
[root@ibm-p8-kvm-03-guest-02 ~]# podman run -it --rm --privileged --workdir=/root/ --volume=/root/ --rootfs /var/cosa bash
Error: reading contents of source directory for copy up into volume e3fdf29705271f0577645777711e2517feec51d5c99228c106ef9b2fe071e7ee: open /var/cosa/root: permission denied
I'm not sure why it's failing, but what's more important here is I actually don't want the volume to be pre-populated with anything. So I try with :nocopy but that clearly won't work:
[root@ibm-p8-kvm-03-guest-02 ~]# podman run -it --rm --privileged --workdir=/root/ --volume=/root/:nocopy --rootfs /var/cosa bash
Error: invalid container path "nocopy", must be an absolute path
What does work is if I give the volume a name:
[root@ibm-p8-kvm-03-guest-02 ~]# podman run -it --rm --privileged --workdir=/root/ --volume=volroot:/root/:nocopy --rootfs /var/cosa bash
bash-5.2#bash-5.2# exit
exit
[root@ibm-p8-kvm-03-guest-02 ~]# podman volume list
DRIVER VOLUME NAME
local volroot
but clearly as shown above, now I'm leaking volumes when I'd prefer not to.
Is there any way to pass options when you don't specify a host path? I guess if the answer is currently "no" one future solution could be to come up with a special name the user can use to request an anonymous volume explicitly.
Steps to reproduce the issue
Steps to reproduce the issue
podman run -it --rm --privileged --workdir=/root/ --volume=/root/:nocopy --rootfs /var/cosa bash
Describe the results you received
Error: invalid container path "nocopy", must be an absolute path
Describe the results you expected
Anonymous volume with :nocopy option enforced.
podman info output
<details>podman info host:
arch: amd64buildahVersion: 1.38.1cgroupControllers:
- cpuset
- cpu
- io
- memory
- hugetlb
- pids
- rdma
- misccgroupManager: systemdcgroupVersion: v2conmon:
package: conmon-2.1.12-4.fc42.x86_64path: /usr/bin/conmonversion: 'conmon version 2.1.12, commit: 'cpuUtilization:
idlePercent: 88.94systemPercent: 8.24userPercent: 2.82cpus: 1databaseBackend: sqlitedistribution:
distribution: fedoravariant: coreosversion: "42"eventLogger: journaldfreeLocks: 2046hostname: ibm-p8-kvm-03-guest-02.virt.pnr.lab.eng.rdu2.redhat.comidMappings:
gidmap: nulluidmap: nullkernel: 6.13.0-0.rc7.20250114gitc45323b7560e.56.fc42.x86_64linkmode: dynamiclogDriver: journaldmemFree: 689229824memTotal: 2052243456networkBackend: netavarknetworkBackendInfo:
backend: netavarkdns:
package: aardvark-dns-1.13.1-2.fc42.x86_64path: /usr/libexec/podman/aardvark-dnsversion: aardvark-dns 1.13.1package: netavark-1.13.1-2.fc42.x86_64path: /usr/libexec/podman/netavarkversion: netavark 1.13.1ociRuntime:
name: crunpackage: crun-1.19.1-4.fc42.x86_64path: /usr/bin/crunversion: |- crun version 1.19.1 commit: 3e32a70c93f5aa5fea69b50256cca7fd4aa23c80 rundir: /run/crun spec: 1.0.0 +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +LIBKRUN +WASM:wasmedge +YAJLos: linuxpasta:
executable: /usr/sbin/pastapackage: passt-0^20250121.g4f2c8e7-2.fc42.x86_64version: | pasta 0^20250121.g4f2c8e7-2.fc42.x86_64 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/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: falseseccompEnabled: trueseccompProfilePath: /usr/share/containers/seccomp.jsonselinuxEnabled: trueserviceIsRemote: falseslirp4netns:
executable: /usr/sbin/slirp4netnspackage: slirp4netns-1.3.1-2.fc42.x86_64version: |- slirp4netns version 1.3.1 commit: e5e368c4f5db6ae75c2fce786e31eef9da6bf236 libslirp: 4.8.0 SLIRP_CONFIG_VERSION_MAX: 5 libseccomp: 2.5.5swapFree: 0swapTotal: 0uptime: 0h 6m 27.00svariant: ""plugins:
authorization: nulllog:
- k8s-file
- none
- passthrough
- journaldnetwork:
- bridge
- macvlan
- ipvlanvolume:
- localregistries:
search:
- registry.fedoraproject.org
- registry.access.redhat.com
- docker.iostore:
configFile: /usr/share/containers/storage.confcontainerStore:
number: 1paused: 0running: 1stopped: 0graphDriverName: overlaygraphOptions:
overlay.imagestore: /usr/lib/containers/storageoverlay.mountopt: nodev,metacopy=ongraphRoot: /var/lib/containers/storagegraphRootAllocated: 10464022528graphRootUsed: 271036416graphStatus:
Backing Filesystem: extfsNative Overlay Diff: "false"Supports d_type: "true"Supports shifting: "true"Supports volatile: "true"Using metacopy: "true"imageCopyTmpDir: /var/tmpimageStore:
number: 1runRoot: /run/containers/storagetransientStore: falsevolumePath: /var/lib/containers/storage/volumesversion:
APIVersion: 5.3.2Built: 1737504000BuiltTime: Wed Jan 22 00:00:00 2025GitCommit: ""GoVersion: go1.24rc2Os: linuxOsArch: linux/amd64Version: 5.3.2</details>
Podman in a container
No
Privileged Or Rootless
Privileged
Upstream Latest Release
No
Additional environment details
Additional environment details
Additional information
Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting
The text was updated successfully, but these errors were encountered:
I find the --volume syntax quite overloaded, for the parser to makes sense we have three main states /ctr-path -> anonymous volume, pathOrVolume:/ctr-path -> regular bind mount or volume mount, pathOrVolume:/ctr-path:options -> the same but with extra options.
As such it must parse you example as source:dest, sure we could come up with ways to allow that, i.e. :/ctr-path:options where the source would be left empty to signal anonymous volume. However I would dislike that very much because it is easy to cause bugs if we allow an empty part there, consider something like $SOURCE:/dest:opts where the var is empty.
Given the source a special name as you suggested is another way but that also leaves the question of what name and given volume names can be anything today we cannot break backwards compatibility but introducing a special name all of the sudden.
I think using --mount is much better suited to handle these, the argument parser there is IMO cleaner. An anonymous volume is defined as --mount type=volume,dst=/etc. And then options are just comma separated after it. Now nocopy isn't parsed either today so it does not solve your issue today either but I think adding it there is better
Issue Description
I'm running a
podman --rootfs
container with a rootfs path that is read-only and I want to be able to make some of the paths inside the container read/write with volumes. The problem is that--volume=/path
to give me an anonymous volume that will get cleaned up when the container gets cleaned up isn't working because the copy up to initially populate the volume is failing:I'm not sure why it's failing, but what's more important here is I actually don't want the volume to be pre-populated with anything. So I try with
:nocopy
but that clearly won't work:What does work is if I give the volume a name:
but clearly as shown above, now I'm leaking volumes when I'd prefer not to.
Is there any way to pass options when you don't specify a host path? I guess if the answer is currently "no" one future solution could be to come up with a special name the user can use to request an anonymous volume explicitly.
Steps to reproduce the issue
Steps to reproduce the issue
Describe the results you received
Describe the results you expected
Anonymous volume with
:nocopy
option enforced.podman info output
Podman in a container
No
Privileged Or Rootless
Privileged
Upstream Latest Release
No
Additional environment details
Additional environment details
Additional information
Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting
The text was updated successfully, but these errors were encountered: