1podman-pod-clone(1)         General Commands Manual        podman-pod-clone(1)
2
3
4

NAME

6       podman-pod-clone - Create a copy of an existing pod
7
8

SYNOPSIS

10       podman pod clone [options] pod name
11
12

DESCRIPTION

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

OPTIONS

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       ┌────┬───────────┬─────┬──────────────┐
74PID 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       host: use the host’s PID namespace for the pod
281       ns: join the specified PID namespace
282       private: create a new namespace for the pod (default)
283
284
285
286   --restart=policy
287       Restart policy to follow when containers exit.  Restart policy does not
288       take  effect  if  a  container is stopped via the podman kill or podman
289       stop commands.
290
291
292       Valid policy values are:
293
294
295no                       : Do not restart containers on exit
296
297never                    : Synonym for no; do not restart con‐
298                tainers on exit
299
300on-failure[:max_retries]  :  Restart containers when they exit
301                with a non-zero exit code, retrying indefinitely or until  the
302                optional max_retries count is hit
303
304always                    : Restart containers when they exit,
305                regardless of status, retrying indefinitely
306
307unless-stopped           : Identical to always
308
309
310
311       Podman provides a  systemd  unit  file,  podman-restart.service,  which
312       restarts containers after a system reboot.
313
314
315       When  running containers in systemd services, use the restart function‐
316       ality provided by systemd.  In other words, do not use this option in a
317       container unit, instead set the Restart= systemd directive in the [Ser‐
318       vice] section.  See podman-systemd.unit(5) and systemd.service(5).
319
320
321       Default restart policy for all the containers in a pod.
322
323
324   --security-opt=option
325       Security Options
326
327
328apparmor=unconfined : Turn off apparmor  confinement  for  the
329                pod
330
331apparmor=alternate-profile : Set the apparmor confinement pro‐
332                file for the pod
333
334label=user:USER: Set the label user for the pod processes
335
336label=role:ROLE: Set the label role for the pod processes
337
338label=type:TYPE: Set the label process type for the  pod  pro‐
339                cesses
340
341label=level:LEVEL: Set the label level for the pod processes
342
343label=filetype:TYPE: Set the label file type for the pod files
344
345label=disable: Turn off label separation for the pod
346
347
348
349       Note:  Labeling  can be disabled for all pods/containers by setting la‐
350       bel=false in the  containers.conf  (/etc/containers/containers.conf  or
351       $HOME/.config/containers/containers.conf) file.
352
353
354label=nested:  Allows  SELinux  modifications  within the con‐
355                tainer. Containers are allowed to  modify  SELinux  labels  on
356                files and processes, as long as SELinux policy allows. Without
357                nested, containers view SELinux as disabled, even when  it  is
358                enabled on the host. Containers are prevented from setting any
359                labels.
360
361mask=/path/1:/path/2: The paths to mask separated by a  colon.
362                A  masked path cannot be accessed inside the containers within
363                the pod.
364
365no-new-privileges: Disable container  processes  from  gaining
366                additional privileges.
367
368seccomp=unconfined: Turn off seccomp confinement for the pod.
369
370seccomp=profile.json:  JSON  file to be used as a seccomp fil‐
371                ter. Note that the io.podman.annotations.seccomp annotation is
372                set with the specified value as shown in podman inspect.
373
374proc-opts=OPTIONS : Comma-separated list of options to use for
375                the /proc mount. More details for the possible  mount  options
376                are specified in the proc(5) man page.
377
378unmask=ALL   or   /path/1:/path/2,  or  shell  expanded  paths
379                (/proc/*): Paths to unmask separated by a  colon.  If  set  to
380                ALL,  it  unmasks  all the paths that are masked or made read-
381                only by default.  The default  masked  paths  are  /proc/acpi,
382                /proc/kcore,  /proc/keys, /proc/latency_stats, /proc/sched_de‐
383                bug,    /proc/scsi,    /proc/timer_list,    /proc/timer_stats,
384                /sys/firmware,  and /sys/fs/selinux, /sys/devices/virtual/pow‐
385                ercap.  The default paths that are read-only are /proc/asound,
386                /proc/bus,  /proc/fs,  /proc/irq, /proc/sys, /proc/sysrq-trig‐
387                ger, /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       ┌────────┬───────────┬─────────────────────┐
486Key     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
509auto[:OPTIONS,...]:  automatically  create  a namespace. It is
510                possible to specify these options to auto:
511
512gidmapping=CONTAINER_GID:HOST_GID:SIZE to force a GID  mapping
513                to be present in the user namespace.
514
515size=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
519uidmapping=CONTAINER_UID:HOST_UID:SIZE  to force a UID mapping
520                to be present in the user namespace.
521
522host: 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
526keep-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
531nomap:  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
542host: use the host's UTS namespace inside the pod.
543
544private: create a new namespace for the pod (default).
545
546ns:[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
569rw|ro
570
571z|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
589idmap[=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  -Rt  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          $ podman pod clone --security-opt label=disable -v $HOME:/home/user fedora touch /home/user/file
675
676
677
678       Overlay Volume Mounts
679
680
681       The :O flag tells Podman to mount the directory from the host as a tem‐
682       porary storage using the overlay file system.  The  pod  processes  can
683       modify  content  within the mountpoint which is stored in the container
684       storage in a separate directory. In overlay terms, the source directory
685       is the lower, and the container storage directory is the upper. Modifi‐
686       cations to the mount point are destroyed when the pod finishes  execut‐
687       ing, similar to a tmpfs mount point being unmounted.
688
689
690       For  advanced  users,  the  overlay  option  also  supports custom non-
691       volatile upperdir and workdir for the overlay  mount.  Custom  upperdir
692       and  workdir  can  be fully managed by the users themselves, and Podman
693       does  not  remove  it  on   lifecycle   completion.    Example   :O,up‐
694       perdir=/some/upper,workdir=/some/work
695
696
697       Subsequent  executions of the container sees the original source direc‐
698       tory content, any changes from previous pod executions no longer exist.
699
700
701       One use case of the overlay mount is sharing the package cache from the
702       host into the container to allow speeding up builds.
703
704
705       Note: The O flag conflicts with other options listed above.
706
707
708       Content mounted into the container is labeled with the private label.
709              On SELinux systems, labels in the source directory must be read‐
710       able by the pod infra container label. Usually containers can read/exe‐
711       cute  container_share_t  and can read/write container_file_t. If unable
712       to change the labels on a source volume, SELinux  container  separation
713       must be disabled for the pod or infra container to work.
714            -  Do not modify the source directory mounted into the pod with an
715       overlay mount, it can cause unexpected failures. Only modify the direc‐
716       tory after the container finishes running.
717
718
719       Mounts propagation
720
721
722       By default bind mounted volumes are private. That means any mounts done
723       inside the pod is not visible on host and vice versa.  One  can  change
724       this behavior by specifying a volume mount propagation property. Making
725       a volume shared mounts done under that volume inside the pod is visible
726       on  host  and  vice  versa.  Making a volume slave enables only one way
727       mount propagation and that is mounts done on host under that volume  is
728       visible inside container but not the other way around. [1] ⟨#Footnote1⟩
729
730
731       To  control  mount  propagation  property  of  a volume one can use the
732       [r]shared, [r]slave, [r]private or the [r]unbindable propagation  flag.
733       Propagation property can be specified only for bind mounted volumes and
734       not for internal volumes or named volumes.  For  mount  propagation  to
735       work  the  source  mount  point  (the  mount  point where source dir is
736       mounted on) has to have the right propagation  properties.  For  shared
737       volumes,  the  source  mount point has to be shared. And for slave vol‐
738       umes, the source mount point has to be either  shared  or  slave.   [1]
739       ⟨#Footnote1⟩
740
741
742       To  recursively mount a volume and all of its submounts into a pod, use
743       the rbind option. By default the bind option is used, and submounts  of
744       the source directory is not mounted into the pod.
745
746
747       Mounting  the  volume  with  a copy option tells podman to copy content
748       from the underlying destination directory onto newly  created  internal
749       volumes.  The  copy only happens on the initial creation of the volume.
750       Content is not copied up when the volume is subsequently used  on  dif‐
751       ferent containers. The copy option is ignored on bind mounts and has no
752       effect.
753
754
755       Mounting volumes with the nosuid options means that SUID executables on
756       the  volume  can not be used by applications to change their privilege.
757       By default volumes are mounted with nosuid.
758
759
760       Mounting the volume with the noexec option means that no executables on
761       the volume can be executed within the pod.
762
763
764       Mounting  the volume with the nodev option means that no devices on the
765       volume can be used by processes within the pod. By default volumes  are
766       mounted with nodev.
767
768
769       If  the HOST-DIR is a mount point, then dev, suid, and exec options are
770       ignored by the kernel.
771
772
773       Use df HOST-DIR to figure out the source mount,  then  use  findmnt  -o
774       TARGET,PROPAGATION  source-mount-dir  to figure out propagation proper‐
775       ties of source mount. If findmnt(1) utility is not available, then  one
776       can   look   at   the  mount  entry  for  the  source  mount  point  in
777       /proc/self/mountinfo. Look at the "optional  fields"  and  see  if  any
778       propagation  properties  are  specified.   In there, shared:N means the
779       mount is shared, master:N means mount  is  slave,  and  if  nothing  is
780       there, the mount is private. [1] ⟨#Footnote1⟩
781
782
783       To  change  propagation  properties of a mount point, use mount(8) com‐
784       mand. For example, if one wants to bind mount  source  directory  /foo,
785       one  can  do  mount  --bind  /foo /foo and mount --make-private --make-
786       shared /foo. This converts /foo into a  shared  mount  point.  Alterna‐
787       tively, one can directly change propagation properties of source mount.
788       Say / is source mount for /foo, then use mount --make-shared / to  con‐
789       vert / into a shared mount.
790
791
792       Note:  if  the  user  only has access rights via a group, accessing the
793       volume from inside a rootless pod fails.
794
795
796       Idmapped mount
797
798
799       If idmap is specified, create an idmapped  mount  to  the  target  user
800       namespace  in the container. The idmap option supports a custom mapping
801       that can be different than the user namespace used  by  the  container.
802       The   mapping   can   be   specified   after  the  idmap  option  like:
803       idmap=uids=0-1-10#10-11-10;gids=0-100-10.  For each triplet, the  first
804       value  is  the  start of the backing file system IDs that are mapped to
805       the second value on the host.  The length of this mapping is  given  in
806       the third value.  Multiple ranges are separated with #.
807
808
809   --volumes-from=CONTAINER[:OPTIONS]
810       Mount  volumes  from  the specified container(s). Used to share volumes
811       between containers and pods. The options is a comma-separated list with
812       the following available elements:
813
814
815rw|ro
816
817z
818
819
820
821       Mounts  already  mounted  volumes  from a source container onto another
822       pod. CONTAINER may be a name or ID.  To share a volume, use the  --vol‐
823       umes-from  option  when  running  the  target container. Volumes can be
824       shared even if the source container is not running.
825
826
827       By default, Podman mounts the volumes in the same mode  (read-write  or
828       read-only)  as  it  is  mounted  in  the source container.  This can be
829       changed by adding a ro or rw option.
830
831
832       Labeling systems like SELinux require that proper labels are placed  on
833       volume content mounted into a pod. Without a label, the security system
834       might prevent the processes running inside the container from using the
835       content. By default, Podman does not change the labels set by the OS.
836
837
838       To  change a label in the pod context, add z to the volume mount.  This
839       suffix tells Podman to relabel file objects on the shared volumes.  The
840       z  option tells Podman that two entities share the volume content. As a
841       result, Podman labels the content with a shared content  label.  Shared
842       volume labels allow all containers to read/write content.
843
844
845       If  the  location of the volume from the source container overlaps with
846       data residing on a target pod, then the volume hides that data  on  the
847       target.
848
849

EXAMPLES

851       # podman pod clone pod-name
852       6b2c73ff8a1982828c9ae2092954bcd59836a131960f7e05221af9df5939c584
853
854
855       # podman pod clone --name=cloned-pod
856       d0cf1f782e2ed67e8c0050ff92df865a039186237a4df24d7acba5b1fa8cc6e7
857       6b2c73ff8a1982828c9ae2092954bcd59836a131960f7e05221af9df5939c584
858
859
860       # podman pod clone --destroy --cpus=5 d0cf1f782e2ed67e8c0050ff92df865a039186237a4df24d7acba5b1fa8cc6e7
861       6b2c73ff8a1982828c9ae2092954bcd59836a131960f7e05221af9df5939c584
862
863
864       # podman pod clone 2d4d4fca7219b4437e0d74fcdc272c4f031426a6eacd207372691207079551de new_name
865       5a9b7851013d326aa4ac4565726765901b3ecc01fcbc0f237bc7fd95588a24f9
866
867
868

SEE ALSO

870       podman-pod-create(1)
871
872

HISTORY

874       May   2022,  Originally  written  by  Charlie  Doern  cdoern@redhat.com
875       ⟨mailto:cdoern@redhat.com⟩
876
877

FOOTNOTES

879       1: The Podman project is committed to inclusivity, a core value of open
880       source. The master and slave mount propagation terminology used here is
881       problematic and divisive, and needs to be changed. However, these terms
882       are  currently  used  within the Linux kernel and must be used as-is at
883       this time. When the kernel maintainers rectify this usage, Podman  will
884       follow suit immediately.
885
886
887
888                                                           podman-pod-clone(1)
Impressum