github.com/containers/podman/v5@v5.1.0-rc1/docs/source/markdown/options/mount.md (about) 1 ####> This option file is used in: 2 ####> podman create, run 3 ####> If file is edited, make sure the changes 4 ####> are applicable to all of those. 5 #### **--mount**=*type=TYPE,TYPE-SPECIFIC-OPTION[,...]* 6 7 Attach a filesystem mount to the container 8 9 Current supported mount TYPEs are **bind**, **devpts**, **glob**, **image**, **ramfs**, **tmpfs** and **volume**. 10 11 Options common to all mount types: 12 13 - *src*, *source*: mount source spec for **bind**, **glob**, and **volume**. 14 Mandatory for **bind** and **glob**. 15 16 - *dst*, *destination*, *target*: mount destination spec. 17 18 When source globs are specified without the destination directory, 19 the files and directories are mounted with their complete path 20 within the container. When the destination is specified, the 21 files and directories matching the glob on the base file name 22 on the destination directory are mounted. The option 23 `type=glob,src=/foo*,destination=/tmp/bar` tells container engines 24 to mount host files matching /foo* to the /tmp/bar/ 25 directory in the container. 26 27 Options specific to type=**volume**: 28 29 - *ro*, *readonly*: *true* or *false* (default if unspecified: *false*). 30 31 - *U*, *chown*: *true* or *false* (default if unspecified: *false*). Recursively change the owner and group of the source volume based on the UID and GID of the container. 32 33 - *idmap*: If specified, create an idmapped mount to the target user namespace in the container. 34 The idmap option supports a custom mapping that can be different than the user namespace used by the container. 35 The mapping can be specified after the idmap option like: `idmap=uids=0-1-10#10-11-10;gids=0-100-10`. For each triplet, the first value is the 36 start of the backing file system IDs that are mapped to the second value on the host. The length of this mapping is given in the third value. 37 Multiple ranges are separated with #. If the specified mapping is prepended with a '@' then the mapping is considered relative to the container 38 user namespace. The host ID for the mapping is changed to account for the relative position of the container user in the container user namespace. 39 40 Options specific to type=**image**: 41 42 - *rw*, *readwrite*: *true* or *false* (default if unspecified: *false*). 43 44 - *subpath*: Mount only a specific path within the image, instead of the whole image. 45 46 Options specific to **bind** and **glob**: 47 48 - *ro*, *readonly*: *true* or *false* (default if unspecified: *false*). 49 50 - *bind-propagation*: *shared*, *slave*, *private*, *unbindable*, *rshared*, *rslave*, *runbindable*, or **rprivate** (default).<sup>[[1]](#Footnote1)</sup> See also mount(2). 51 52 - *bind-nonrecursive*: do not set up a recursive bind mount. By default it is recursive. 53 54 - *relabel*: *shared*, *private*. 55 56 - *idmap*: *true* or *false* (default if unspecified: *false*). If true, create an idmapped mount to the target user namespace in the container. 57 58 - *U*, *chown*: *true* or *false* (default if unspecified: *false*). Recursively change the owner and group of the source volume based on the UID and GID of the container. 59 60 - *no-dereference*: do not dereference symlinks but copy the link source into the mount destination. 61 62 Options specific to type=**tmpfs** and **ramfs**: 63 64 - *ro*, *readonly*: *true* or *false* (default if unspecified: *false*). 65 66 - *tmpfs-size*: Size of the tmpfs/ramfs mount, in bytes. Unlimited by default in Linux. 67 68 - *tmpfs-mode*: Octal file mode of the tmpfs/ramfs (e.g. 700 or 0700.). 69 70 - *tmpcopyup*: Enable copyup from the image directory at the same location to the tmpfs/ramfs. Used by default. 71 72 - *notmpcopyup*: Disable copying files from the image to the tmpfs/ramfs. 73 74 - *U*, *chown*: *true* or *false* (default if unspecified: *false*). Recursively change the owner and group of the source volume based on the UID and GID of the container. 75 76 Options specific to type=**devpts**: 77 78 - *uid*: numeric UID of the file owner (default: 0). 79 80 - *gid*: numeric GID of the file owner (default: 0). 81 82 - *mode*: octal permission mask for the file (default: 600). 83 84 - *max*: maximum number of PTYs (default: 1048576). 85 86 Examples: 87 88 - `type=bind,source=/path/on/host,destination=/path/in/container` 89 90 - `type=bind,src=/path/on/host,dst=/path/in/container,relabel=shared` 91 92 - `type=bind,src=/path/on/host,dst=/path/in/container,relabel=shared,U=true` 93 94 - `type=devpts,destination=/dev/pts` 95 96 - `type=glob,src=/usr/lib/libfoo*,destination=/usr/lib,ro=true` 97 98 - `type=image,source=fedora,destination=/fedora-image,rw=true` 99 100 - `type=ramfs,tmpfs-size=512M,destination=/path/in/container` 101 102 - `type=tmpfs,tmpfs-size=512M,destination=/path/in/container` 103 104 - `type=tmpfs,destination=/path/in/container,noswap` 105 106 - `type=volume,source=vol1,destination=/path/in/container,ro=true`