1podman-pod-clone(1) General Commands Manual podman-pod-clone(1)
2
3
4
6 podman-pod-clone - Create a copy of an existing pod
7
8
10 podman pod clone [options] pod name
11
12
14 podman pod clone creates a copy of a pod, recreating the identical con‐
15 fig for the pod and for all of its containers. Users can modify the
16 pods new name and select pod details within the infra container
17
18
20 --blkio-weight=weight
21 Block IO relative weight. The weight is a value between 10 and 1000.
22
23
24 This option is not supported on cgroups V1 rootless systems.
25
26
27 --blkio-weight-device=device:weight
28 Block IO relative device weight.
29
30
31 --cgroup-parent=path
32 Path to cgroups under which the cgroup for the pod is created. If the
33 path is not absolute, the path is considered to be relative to the
34 cgroups path of the init process. Cgroups are created if they do not
35 already exist.
36
37
38 --cpu-shares, -c=shares
39 CPU shares (relative weight).
40
41
42 By default, all containers get the same proportion of CPU cycles. This
43 proportion can be modified by changing the container's CPU share
44 weighting relative to the combined weight of all the running contain‐
45 ers. Default weight is 1024.
46
47
48 The proportion only applies when CPU-intensive processes are running.
49 When tasks in one container are idle, other containers can use the
50 left-over CPU time. The actual amount of CPU time varies depending on
51 the number of containers running on the system.
52
53
54 For example, consider three containers, one has a cpu-share of 1024 and
55 two others have a cpu-share setting of 512. When processes in all three
56 containers attempt to use 100% of CPU, the first container receives 50%
57 of the total CPU time. If a fourth container is added with a cpu-share
58 of 1024, the first container only gets 33% of the CPU. The remaining
59 containers receive 16.5%, 16.5% and 33% of the CPU.
60
61
62 On a multi-core system, the shares of CPU time are distributed over all
63 CPU cores. Even if a container is limited to less than 100% of CPU
64 time, it can use 100% of each individual CPU core.
65
66
67 For example, consider a system with more than three cores. If the con‐
68 tainer C0 is started with --cpu-shares=512 running one process, and an‐
69 other container C1 with --cpu-shares=1024 running two processes, this
70 can result in the following division of CPU shares:
71
72
73 ┌────┬───────────┬─────┬──────────────┐
74 │PID │ container │ CPU │ CPU share │
75 ├────┼───────────┼─────┼──────────────┤
76 │100 │ C0 │ 0 │ 100% of CPU0 │
77 ├────┼───────────┼─────┼──────────────┤
78 │101 │ C1 │ 1 │ 100% of CPU1 │
79 ├────┼───────────┼─────┼──────────────┤
80 │102 │ C1 │ 2 │ 100% of CPU2 │
81 └────┴───────────┴─────┴──────────────┘
82
83 On some systems, changing the resource limits may not be allowed for
84 non-root users. For more details, see https://github.com/contain‐
85 ers/podman/blob/main/troubleshooting.md#26-running-containers-with-re‐
86 source-limits-fails-with-a-permissions-error
87
88
89 This option is not supported on cgroups V1 rootless systems.
90
91
92 --cpus
93 Set a number of CPUs for the pod that overrides the original pods CPU
94 limits. If none are specified, the original pod's Nano CPUs are used.
95
96
97 --cpuset-cpus=number
98 CPUs in which to allow execution. Can be specified as a comma-separated
99 list (e.g. 0,1), as a range (e.g. 0-3), or any combination thereof
100 (e.g. 0-3,7,11-15).
101
102
103 On some systems, changing the resource limits may not be allowed for
104 non-root users. For more details, see https://github.com/contain‐
105 ers/podman/blob/main/troubleshooting.md#26-running-containers-with-re‐
106 source-limits-fails-with-a-permissions-error
107
108
109 This option is not supported on cgroups V1 rootless systems.
110
111
112 If none are specified, the original pod's CPUset is used.
113
114
115 --cpuset-mems=nodes
116 Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effec‐
117 tive on NUMA systems.
118
119
120 If there are four memory nodes on the system (0-3), use --cpuset-
121 mems=0,1 then processes in the container only uses memory from the
122 first two memory nodes.
123
124
125 On some systems, changing the resource limits may not be allowed for
126 non-root users. For more details, see https://github.com/contain‐
127 ers/podman/blob/main/troubleshooting.md#26-running-containers-with-re‐
128 source-limits-fails-with-a-permissions-error
129
130
131 This option is not supported on cgroups V1 rootless systems.
132
133
134 --destroy
135 Remove the original pod that we are cloning once used to mimic the con‐
136 figuration.
137
138
139 --device=host-device[:container-device][:permissions]
140 Add a host device to the pod. Optional permissions parameter can be
141 used to specify device permissions by combining r for read, w for
142 write, and m for mknod(2).
143
144
145 Example: --device=/dev/sdc:/dev/xvdc:rwm.
146
147
148 Note: if host-device is a symbolic link then it is resolved first. The
149 pod only stores the major and minor numbers of the host device.
150
151
152 Podman may load kernel modules required for using the specified device.
153 The devices that Podman loads modules for when necessary are:
154 /dev/fuse.
155
156
157 In rootless mode, the new device is bind mounted in the container from
158 the host rather than Podman creating it within the container space. Be‐
159 cause the bind mount retains its SELinux label on SELinux systems, the
160 container can get permission denied when accessing the mounted device.
161 Modify SELinux settings to allow containers to use all device labels
162 via the following command:
163
164
165 $ sudo setsebool -P container_use_devices=true
166
167
168 Note: the pod implements devices by storing the initial configuration
169 passed by the user and recreating the device on each container added to
170 the pod.
171
172
173 --device-read-bps=path:rate
174 Limit read rate (in bytes per second) from a device (e.g. --device-
175 read-bps=/dev/sda:1mb).
176
177
178 On some systems, changing the resource limits may not be allowed for
179 non-root users. For more details, see https://github.com/contain‐
180 ers/podman/blob/main/troubleshooting.md#26-running-containers-with-re‐
181 source-limits-fails-with-a-permissions-error
182
183
184 This option is not supported on cgroups V1 rootless systems.
185
186
187 --device-write-bps=path:rate
188 Limit write rate (in bytes per second) to a device (e.g. --device-
189 write-bps=/dev/sda:1mb).
190
191
192 On some systems, changing the resource limits may not be allowed for
193 non-root users. For more details, see https://github.com/contain‐
194 ers/podman/blob/main/troubleshooting.md#26-running-containers-with-re‐
195 source-limits-fails-with-a-permissions-error
196
197
198 This option is not supported on cgroups V1 rootless systems.
199
200
201 --gidmap=pod_gid:host_gid:amount
202 GID map for the user namespace. Using this flag runs all containers in
203 the pod with user namespace enabled. It conflicts with the --userns
204 and --subgidname flags.
205
206
207 --help, -h
208 Print usage statement.
209
210
211 --hostname=name
212 Set a hostname to the pod.
213
214
215 --infra-command=command
216 The command that is run to start the infra container. Default:
217 "/pause".
218
219
220 --infra-conmon-pidfile=file
221 Write the pid of the infra container's conmon process to a file. As
222 conmon runs in a separate process than Podman, this is necessary when
223 using systemd to manage Podman containers and pods.
224
225
226 --infra-name=name
227 The name that is used for the pod's infra container.
228
229
230 --label, -l=key=value
231 Add metadata to a pod.
232
233
234 --label-file=file
235 Read in a line-delimited file of labels.
236
237
238 --memory, -m=number[unit]
239 Memory limit. A unit can be b (bytes), k (kibibytes), m (mebibytes), or
240 g (gibibytes).
241
242
243 Allows the memory available to a container to be constrained. If the
244 host supports swap memory, then the -m memory setting can be larger
245 than physical RAM. If a limit of 0 is specified (not using -m), the
246 container's memory is not limited. The actual limit may be rounded up
247 to a multiple of the operating system's page size (the value is very
248 large, that's millions of trillions).
249
250
251 This option is not supported on cgroups V1 rootless systems.
252
253
254 --memory-swap=number[unit]
255 A limit value equal to memory plus swap. A unit can be b (bytes), k
256 (kibibytes), m (mebibytes), or g (gibibytes).
257
258
259 Must be used with the -m (--memory) flag. The argument value must be
260 larger than that of
261 -m (--memory) By default, it is set to double the value of --memory.
262
263
264 Set number to -1 to enable unlimited swap.
265
266
267 This option is not supported on cgroups V1 rootless systems.
268
269
270 --name, -n
271 Set a custom name for the cloned pod. The default if not specified is
272 of the syntax: <ORIGINAL_NAME>-clone
273
274
275 --pid=pid
276 Set the PID mode for the pod. The default is to create a private PID
277 namespace for the pod. Requires the PID namespace to be shared via
278 --share.
279
280
281 host: use the host’s PID namespace for the pod
282 ns: join the specified PID namespace
283 private: create a new namespace for the pod (default)
284
285
286
287 --restart=policy
288 Restart policy to follow when containers exit. Restart policy does not
289 take effect if a container is stopped via the podman kill or podman
290 stop commands.
291
292
293 Valid policy values are:
294
295
296 • no : Do not restart containers on exit
297
298 • never : Synonym for no; do not restart con‐
299 tainers on exit
300
301 • on-failure[:max_retries] : Restart containers when they exit
302 with a non-zero exit code, retrying indefinitely or until the
303 optional max_retries count is hit
304
305 • always : Restart containers when they exit,
306 regardless of status, retrying indefinitely
307
308 • unless-stopped : Identical to always
309
310
311
312 Podman provides a systemd unit file, podman-restart.service, which
313 restarts containers after a system reboot.
314
315
316 When running containers in systemd services, use the restart function‐
317 ality provided by systemd. In other words, do not use this option in a
318 container unit, instead set the Restart= systemd directive in the [Ser‐
319 vice] section. See podman-systemd.unit(5) and systemd.service(5).
320
321
322 Default restart policy for all the containers in a pod.
323
324
325 --security-opt=option
326 Security Options
327
328
329 • apparmor=unconfined : Turn off apparmor confinement for the
330 pod
331
332 • apparmor=alternate-profile : Set the apparmor confinement pro‐
333 file for the pod
334
335 • label=user:USER: Set the label user for the pod processes
336
337 • label=role:ROLE: Set the label role for the pod processes
338
339 • label=type:TYPE: Set the label process type for the pod pro‐
340 cesses
341
342 • label=level:LEVEL: Set the label level for the pod processes
343
344 • label=filetype:TYPE: Set the label file type for the pod files
345
346 • label=disable: Turn off label separation for the pod
347
348
349
350 Note: Labeling can be disabled for all pods/containers by setting la‐
351 bel=false in the containers.conf (/etc/containers/containers.conf or
352 $HOME/.config/containers/containers.conf) file.
353
354
355 • label=nested: Allows SELinux modifications within the con‐
356 tainer. Containers are allowed to modify SELinux labels on
357 files and processes, as long as SELinux policy allows. Without
358 nested, containers view SELinux as disabled, even when it is
359 enabled on the host. Containers are prevented from setting any
360 labels.
361
362 • mask=/path/1:/path/2: The paths to mask separated by a colon.
363 A masked path cannot be accessed inside the containers within
364 the pod.
365
366 • no-new-privileges: Disable container processes from gaining
367 additional privileges.
368
369 • seccomp=unconfined: Turn off seccomp confinement for the pod.
370
371 • seccomp=profile.json: JSON file to be used as a seccomp fil‐
372 ter. Note that the io.podman.annotations.seccomp annotation is
373 set with the specified value as shown in podman inspect.
374
375 • proc-opts=OPTIONS : Comma-separated list of options to use for
376 the /proc mount. More details for the possible mount options
377 are specified in the proc(5) man page.
378
379 • unmask=ALL or /path/1:/path/2, or shell expanded paths
380 (/proc/*): Paths to unmask separated by a colon. If set to
381 ALL, it unmasks all the paths that are masked or made read-
382 only by default. The default masked paths are /proc/acpi,
383 /proc/kcore, /proc/keys, /proc/latency_stats, /proc/sched_de‐
384 bug, /proc/scsi, /proc/timer_list, /proc/timer_stats,
385 /sys/firmware, and /sys/fs/selinux. The default paths that
386 are read-only are /proc/asound, /proc/bus, /proc/fs,
387 /proc/irq, /proc/sys, /proc/sysrq-trigger, /sys/fs/cgroup.
388
389
390
391 Note: Labeling can be disabled for all containers by setting la‐
392 bel=false in the containers.conf(5) file.
393
394
395 --shm-size=number[unit]
396 Size of /dev/shm. A unit can be b (bytes), k (kibibytes), m
397 (mebibytes), or g (gibibytes). If the unit is omitted, the system uses
398 bytes. If the size is omitted, the default is 64m. When size is 0,
399 there is no limit on the amount of memory used for IPC by the pod.
400 This option conflicts with --ipc=host.
401
402
403 --shm-size-systemd=number[unit]
404 Size of systemd-specific tmpfs mounts such as /run, /run/lock,
405 /var/log/journal and /tmp. A unit can be b (bytes), k (kibibytes), m
406 (mebibytes), or g (gibibytes). If the unit is omitted, the system uses
407 bytes. If the size is omitted, the default is 64m. When size is 0, the
408 usage is limited to 50% of the host's available memory.
409
410
411 --start
412 When set to true, this flag starts the newly created pod after the
413 clone process has completed. All containers within the pod are started.
414
415
416 --subgidname=name
417 Run the container in a new user namespace using the map with name in
418 the /etc/subgid file. If running rootless, the user needs to have the
419 right to use the mapping. See subgid(5). This flag conflicts with
420 --userns and --gidmap.
421
422
423 --subuidname=name
424 Run the container in a new user namespace using the map with name in
425 the /etc/subuid file. If running rootless, the user needs to have the
426 right to use the mapping. See subuid(5). This flag conflicts with
427 --userns and --uidmap.
428
429
430 --sysctl=name=value
431 Configure namespaced kernel parameters for all containers in the pod.
432
433
434 For the IPC namespace, the following sysctls are allowed:
435
436
437 • kernel.msgmax
438
439 • kernel.msgmnb
440
441 • kernel.msgmni
442
443 • kernel.sem
444
445 • kernel.shmall
446
447 • kernel.shmmax
448
449 • kernel.shmmni
450
451 • kernel.shm_rmid_forced
452
453 • Sysctls beginning with fs.mqueue.*
454
455
456
457 Note: if the ipc namespace is not shared within the pod, the above
458 sysctls are not allowed.
459
460
461 For the network namespace, only sysctls beginning with net.* are al‐
462 lowed.
463
464
465 Note: if the network namespace is not shared within the pod, the above
466 sysctls are not allowed.
467
468
469 --uidmap=container_uid:from_uid:amount
470 Run all containers in the pod in a new user namespace using the sup‐
471 plied mapping. This option conflicts with the --userns and --subuidname
472 options. This option provides a way to map host UIDs to container UIDs.
473 It can be passed several times to map different ranges.
474
475
476 --userns=mode
477 Set the user namespace mode for all the containers in a pod. It de‐
478 faults to the PODMAN_USERNS environment variable. An empty value ("")
479 means user namespaces are disabled.
480
481
482 Rootless user --userns=Key mappings:
483
484
485 ┌────────┬───────────┬─────────────────────┐
486 │Key │ Host User │ Container User │
487 ├────────┼───────────┼─────────────────────┤
488 │"" │ $UID │ 0 (Default User ac‐ │
489 │ │ │ count mapped to │
490 │ │ │ root user in con‐ │
491 │ │ │ tainer.) │
492 ├────────┼───────────┼─────────────────────┤
493 │keep-id │ $UID │ $UID (Map user ac‐ │
494 │ │ │ count to same UID │
495 │ │ │ within container.) │
496 ├────────┼───────────┼─────────────────────┤
497 │auto │ $UID │ nil (Host User UID │
498 │ │ │ is not mapped into │
499 │ │ │ container.) │
500 ├────────┼───────────┼─────────────────────┤
501 │nomap │ $UID │ nil (Host User UID │
502 │ │ │ is not mapped into │
503 │ │ │ container.) │
504 └────────┴───────────┴─────────────────────┘
505
506 Valid mode values are:
507
508
509 • auto[:OPTIONS,...]: automatically create a namespace. It is
510 possible to specify these options to auto:
511
512 • gidmapping=CONTAINER_GID:HOST_GID:SIZE to force a GID mapping
513 to be present in the user namespace.
514
515 • size=SIZE: to specify an explicit size for the automatic user
516 namespace. e.g. --userns=auto:size=8192. If size is not speci‐
517 fied, auto estimates the size for the user namespace.
518
519 • uidmapping=CONTAINER_UID:HOST_UID:SIZE to force a UID mapping
520 to be present in the user namespace.
521
522 • host: run in the user namespace of the caller. The processes
523 running in the container have the same privileges on the host
524 as any other process launched by the calling user (default).
525
526 • keep-id: creates a user namespace where the current rootless
527 user's UID:GID are mapped to the same values in the container.
528 This option is not allowed for containers created by the root
529 user.
530
531 • nomap: creates a user namespace where the current rootless
532 user's UID:GID are not mapped into the container. This option
533 is not allowed for containers created by the root user.
534
535
536
537 --uts=mode
538 Set the UTS namespace mode for the pod. The following values are sup‐
539 ported:
540
541
542 • host: use the host's UTS namespace inside the pod.
543
544 • private: create a new namespace for the pod (default).
545
546 • ns:[path]: run the pod in the given existing UTS namespace.
547
548
549
550 --volume, -v=[[SOURCE-VOLUME|HOST-DIR:]CONTAINER-DIR[:OPTIONS]]
551 Create a bind mount. If -v /HOST-DIR:/CONTAINER-DIR is specified, Pod‐
552 man bind mounts /HOST-DIR from the host into /CONTAINER-DIR in the Pod‐
553 man container. Similarly, -v SOURCE-VOLUME:/CONTAINER-DIR mounts the
554 named volume from the host into the container. If no such named volume
555 exists, Podman creates one. If no source is given, the volume is cre‐
556 ated as an anonymously named volume with a randomly generated name, and
557 is removed when the pod is removed via the --rm flag or the podman rm
558 --volumes command.
559
560
561 (Note when using the remote client, including Mac and Windows (exclud‐
562 ing WSL2) machines, the volumes are mounted from the remote server, not
563 necessarily the client machine.)
564
565
566 The OPTIONS is a comma-separated list and can be: [1] ⟨#Footnote1⟩
567
568
569 • rw|ro
570
571 • z|Z
572
573 • [O]
574
575 • [U]
576
577 • [no]copy
578
579 • [no]dev
580
581 • [no]exec
582
583 • [no]suid
584
585 • [r]bind
586
587 • [r]shared|[r]slave|[r]private[r]unbindable
588
589 • idmap[=options]
590
591
592
593 The CONTAINER-DIR must be an absolute path such as /src/docs. The vol‐
594 ume is mounted into the container at this directory.
595
596
597 If a volume source is specified, it must be a path on the host or the
598 name of a named volume. Host paths are allowed to be absolute or rela‐
599 tive; relative paths are resolved relative to the directory Podman is
600 run in. If the source does not exist, Podman returns an error. Users
601 must pre-create the source files or directories.
602
603
604 Any source that does not begin with a . or / is treated as the name of
605 a named volume. If a volume with that name does not exist, it is cre‐
606 ated. Volumes created with names are not anonymous, and they are not
607 removed by the --rm option and the podman rm --volumes command.
608
609
610 Specify multiple -v options to mount one or more volumes into a pod.
611
612
613 Write Protected Volume Mounts
614
615
616 Add :ro or :rw option to mount a volume in read-only or read-write
617 mode, respectively. By default, the volumes are mounted read-write.
618 See examples.
619
620
621 Chowning Volume Mounts
622
623
624 By default, Podman does not change the owner and group of source volume
625 directories mounted into containers. If a pod is created in a new user
626 namespace, the UID and GID in the container may correspond to another
627 UID and GID on the host.
628
629
630 The :U suffix tells Podman to use the correct host UID and GID based on
631 the UID and GID within the pod, to change recursively the owner and
632 group of the source volume. Chowning walks the file system under the
633 volume and changes the UID/GID on each file. If the volume has thou‐
634 sands of inodes, this process takes a long time, delaying the start of
635 the pod.
636
637
638 Warning use with caution since this modifies the host filesystem.
639
640
641 Labeling Volume Mounts
642
643
644 Labeling systems like SELinux require that proper labels are placed on
645 volume content mounted into a pod. Without a label, the security system
646 might prevent the processes running inside the pod from using the con‐
647 tent. By default, Podman does not change the labels set by the OS.
648
649
650 To change a label in the pod context, add either of two suffixes :z or
651 :Z to the volume mount. These suffixes tell Podman to relabel file ob‐
652 jects on the shared volumes. The z option tells Podman that two or more
653 pods share the volume content. As a result, Podman labels the content
654 with a shared content label. Shared volume labels allow all containers
655 to read/write content. The Z option tells Podman to label the content
656 with a private unshared label Only the current pod can use a private
657 volume. Relabeling walks the file system under the volume and changes
658 the label on each file, if the volume has thousands of inodes, this
659 process takes a long time, delaying the start of the pod. If the volume
660 was previously relabeled with the z option, Podman is optimized to not
661 relabel a second time. If files are moved into the volume, then the la‐
662 bels can be manually change with the chcon -R container_file_t PATH
663 command.
664
665
666 Note: Do not relabel system files and directories. Relabeling system
667 content might cause other confined services on the machine to fail.
668 For these types of containers we recommend disabling SELinux separa‐
669 tion. The option --security-opt label=disable disables SELinux separa‐
670 tion for the pod. For example if a user wanted to volume mount their
671 entire home directory into a pod, they need to disable SELinux separa‐
672 tion.
673
674
675 $ podman pod clone --security-opt label=disable -v $HOME:/home/user fedora touch /home/user/file
676
677
678
679 Overlay Volume Mounts
680
681
682 The :O flag tells Podman to mount the directory from the host as a tem‐
683 porary storage using the overlay file system. The pod processes can
684 modify content within the mountpoint which is stored in the container
685 storage in a separate directory. In overlay terms, the source directory
686 is the lower, and the container storage directory is the upper. Modifi‐
687 cations to the mount point are destroyed when the pod finishes execut‐
688 ing, similar to a tmpfs mount point being unmounted.
689
690
691 For advanced users, the overlay option also supports custom non-
692 volatile upperdir and workdir for the overlay mount. Custom upperdir
693 and workdir can be fully managed by the users themselves, and Podman
694 does not remove it on lifecycle completion. Example :O,up‐
695 perdir=/some/upper,workdir=/some/work
696
697
698 Subsequent executions of the container sees the original source direc‐
699 tory content, any changes from previous pod executions no longer exist.
700
701
702 One use case of the overlay mount is sharing the package cache from the
703 host into the container to allow speeding up builds.
704
705
706 Note: The O flag conflicts with other options listed above.
707
708
709 Content mounted into the container is labeled with the private label.
710 On SELinux systems, labels in the source directory must be read‐
711 able by the pod infra container label. Usually containers can read/exe‐
712 cute container_share_t and can read/write container_file_t. If unable
713 to change the labels on a source volume, SELinux container separation
714 must be disabled for the pod or infra container to work.
715 - Do not modify the source directory mounted into the pod with an
716 overlay mount, it can cause unexpected failures. Only modify the direc‐
717 tory after the container finishes running.
718
719
720 Mounts propagation
721
722
723 By default bind mounted volumes are private. That means any mounts done
724 inside the pod is not visible on host and vice versa. One can change
725 this behavior by specifying a volume mount propagation property. Making
726 a volume shared mounts done under that volume inside the pod is visible
727 on host and vice versa. Making a volume slave enables only one way
728 mount propagation and that is mounts done on host under that volume is
729 visible inside container but not the other way around. [1] ⟨#Footnote1⟩
730
731
732 To control mount propagation property of a volume one can use the
733 [r]shared, [r]slave, [r]private or the [r]unbindable propagation flag.
734 Propagation property can be specified only for bind mounted volumes and
735 not for internal volumes or named volumes. For mount propagation to
736 work the source mount point (the mount point where source dir is
737 mounted on) has to have the right propagation properties. For shared
738 volumes, the source mount point has to be shared. And for slave vol‐
739 umes, the source mount point has to be either shared or slave. [1]
740 ⟨#Footnote1⟩
741
742
743 To recursively mount a volume and all of its submounts into a pod, use
744 the rbind option. By default the bind option is used, and submounts of
745 the source directory is not mounted into the pod.
746
747
748 Mounting the volume with a copy option tells podman to copy content
749 from the underlying destination directory onto newly created internal
750 volumes. The copy only happens on the initial creation of the volume.
751 Content is not copied up when the volume is subsequently used on dif‐
752 ferent containers. The copy option is ignored on bind mounts and has no
753 effect.
754
755
756 Mounting volumes with the nosuid options means that SUID executables on
757 the volume can not be used by applications to change their privilege.
758 By default volumes are mounted with nosuid.
759
760
761 Mounting the volume with the noexec option means that no executables on
762 the volume can be executed within the pod.
763
764
765 Mounting the volume with the nodev option means that no devices on the
766 volume can be used by processes within the pod. By default volumes are
767 mounted with nodev.
768
769
770 If the HOST-DIR is a mount point, then dev, suid, and exec options are
771 ignored by the kernel.
772
773
774 Use df HOST-DIR to figure out the source mount, then use findmnt -o
775 TARGET,PROPAGATION source-mount-dir to figure out propagation proper‐
776 ties of source mount. If findmnt[4m(1) utility is not available, then one
777 can look at the mount entry for the source mount point in
778 /proc/self/mountinfo. Look at the "optional fields" and see if any
779 propagation properties are specified. In there, shared:N means the
780 mount is shared, master:N means mount is slave, and if nothing is
781 there, the mount is private. [1] ⟨#Footnote1⟩
782
783
784 To change propagation properties of a mount point, use mount(8) com‐
785 mand. For example, if one wants to bind mount source directory /foo,
786 one can do mount --bind /foo /foo and mount --make-private --make-
787 shared /foo. This converts /foo into a shared mount point. Alterna‐
788 tively, one can directly change propagation properties of source mount.
789 Say / is source mount for /foo, then use mount --make-shared / to con‐
790 vert / into a shared mount.
791
792
793 Note: if the user only has access rights via a group, accessing the
794 volume from inside a rootless pod fails.
795
796
797 Idmapped mount
798
799
800 If idmap is specified, create an idmapped mount to the target user
801 namespace in the container. The idmap option supports a custom mapping
802 that can be different than the user namespace used by the container.
803 The mapping can be specified after the idmap option like:
804 idmap=uids=0-1-10#10-11-10;gids=0-100-10. For each triplet, the first
805 value is the start of the backing file system IDs that are mapped to
806 the second value on the host. The length of this mapping is given in
807 the third value. Multiple ranges are separated with #.
808
809
810 --volumes-from=CONTAINER[:OPTIONS]
811 Mount volumes from the specified container(s). Used to share volumes
812 between containers and pods. The options is a comma-separated list with
813 the following available elements:
814
815
816 • rw|ro
817
818 • z
819
820
821
822 Mounts already mounted volumes from a source container onto another
823 pod. CONTAINER may be a name or ID. To share a volume, use the --vol‐
824 umes-from option when running the target container. Volumes can be
825 shared even if the source container is not running.
826
827
828 By default, Podman mounts the volumes in the same mode (read-write or
829 read-only) as it is mounted in the source container. This can be
830 changed by adding a ro or rw option.
831
832
833 Labeling systems like SELinux require that proper labels are placed on
834 volume content mounted into a pod. Without a label, the security system
835 might prevent the processes running inside the container from using the
836 content. By default, Podman does not change the labels set by the OS.
837
838
839 To change a label in the pod context, add z to the volume mount. This
840 suffix tells Podman to relabel file objects on the shared volumes. The
841 z option tells Podman that two entities share the volume content. As a
842 result, Podman labels the content with a shared content label. Shared
843 volume labels allow all containers to read/write content.
844
845
846 If the location of the volume from the source container overlaps with
847 data residing on a target pod, then the volume hides that data on the
848 target.
849
850
852 # podman pod clone pod-name
853 6b2c73ff8a1982828c9ae2092954bcd59836a131960f7e05221af9df5939c584
854
855
856
857 # podman pod clone --name=cloned-pod
858 d0cf1f782e2ed67e8c0050ff92df865a039186237a4df24d7acba5b1fa8cc6e7
859 6b2c73ff8a1982828c9ae2092954bcd59836a131960f7e05221af9df5939c584
860
861
862
863 # podman pod clone --destroy --cpus=5 d0cf1f782e2ed67e8c0050ff92df865a039186237a4df24d7acba5b1fa8cc6e7
864 6b2c73ff8a1982828c9ae2092954bcd59836a131960f7e05221af9df5939c584
865
866
867
868 # podman pod clone 2d4d4fca7219b4437e0d74fcdc272c4f031426a6eacd207372691207079551de new_name
869 5a9b7851013d326aa4ac4565726765901b3ecc01fcbc0f237bc7fd95588a24f9
870
871
872
874 podman-pod-create(1)
875
876
878 May 2022, Originally written by Charlie Doern cdoern@redhat.com
879 ⟨mailto:cdoern@redhat.com⟩
880
881
883 1: The Podman project is committed to inclusivity, a core value of open
884 source. The master and slave mount propagation terminology used here is
885 problematic and divisive, and needs to be changed. However, these terms
886 are currently used within the Linux kernel and must be used as-is at
887 this time. When the kernel maintainers rectify this usage, Podman will
888 follow suit immediately.
889
890
891
892 podman-pod-clone(1)