summaryrefslogtreecommitdiff
path: root/docs/source/markdown/podman-container-clone.1.md.in
blob: 26f414b620dbaa85aa51098bb7c53895d3260d31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
% podman-container-clone(1)

## NAME
podman\-container\-clone - Creates a copy of an existing container

## SYNOPSIS
**podman container clone** [*options*] *container* *name* *image*

## DESCRIPTION
**podman container clone** creates a copy of a container, recreating the original with an identical configuration. This command takes three arguments: the first being the container id or name to clone, the second argument in this command can change the name of the clone from the default of $ORIGINAL_NAME-clone, and the third is a new image to use in the cloned container.

## OPTIONS

@@option blkio-weight

@@option blkio-weight-device

@@option cpu-period

If none is specified, the original container's cpu period is used

@@option cpu-quota

If none is specified, the original container's CPU quota are used.

@@option cpu-rt-period

If none is specified, the original container's CPU runtime period is used.

@@option cpu-rt-runtime

@@option cpu-shares

If none are specified, the original container's CPU shares are used.

#### **--cpus**

Set a number of CPUs for the container that overrides the original containers CPU limits. If none are specified, the original container's Nano CPUs are used.

This is shorthand
for **--cpu-period** and **--cpu-quota**, so only **--cpus** or either both the **--cpu-period** and **--cpu-quota** options can be set.

This option is not supported on cgroups V1 rootless systems.

@@option cpuset-cpus

If none are specified, the original container's CPUset is used.

@@option cpuset-mems

If none are specified, the original container's CPU memory nodes are used.

@@option destroy

#### **--device-read-bps**=*path*

Limit read rate (bytes per second) from a device (e.g. --device-read-bps=/dev/sda:1mb).

This option is not supported on cgroups V1 rootless systems.

#### **--device-write-bps**=*path*

Limit write rate (bytes per second) to a device (e.g. --device-write-bps=/dev/sda:1mb)

This option is not supported on cgroups V1 rootless systems.

#### **--force**, **-f**

Force removal of the original container that we are cloning. Can only be used in conjunction with **--destroy**.

#### **--memory**, **-m**=*limit*

Memory limit (format: `<number>[<unit>]`, where unit = b (bytes), k (kibibytes), m (mebibytes), or g (gibibytes))

Allows the memory available to a container to be constrained. If the host
supports swap memory, then the **-m** memory setting can be larger than physical
RAM. If a limit of 0 is specified (not using **-m**), the container's memory is
not limited. The actual limit may be rounded up to a multiple of the operating
system's page size (the value would be very large, that's millions of trillions).

If no memory limits are specified, the original container's will be used.

This option is not supported on cgroups V1 rootless systems.

#### **--memory-reservation**=*limit*

Memory soft limit (format: `<number>[<unit>]`, where unit = b (bytes), k (kibibytes), m (mebibytes), or g (gibibytes))

After setting memory reservation, when the system detects memory contention
or low memory, containers are forced to restrict their consumption to their
reservation. So you should always set the value below **--memory**, otherwise the
hard limit will take precedence. By default, memory reservation will be the same
as memory limit from the container being cloned.

This option is not supported on cgroups V1 rootless systems.

#### **--memory-swap**=*limit*

A limit value equal to memory plus swap. Must be used with the  **-m**
(**--memory**) flag. The swap `LIMIT` should always be larger than **-m**
(**--memory**) value. By default, the swap `LIMIT` will be set to double
the value of --memory if specified. Otherwise, the container being cloned will be used to derive the swap value.

The format of `LIMIT` is `<number>[<unit>]`. Unit can be `b` (bytes),
`k` (kibibytes), `m` (mebibytes), or `g` (gibibytes). If you don't specify a
unit, `b` is used. Set LIMIT to `-1` to enable unlimited swap.

This option is not supported on cgroups V1 rootless systems.

@@option memory-swappiness

#### **--name**

Set a custom name for the cloned container. The default if not specified is of the syntax: **<ORIGINAL_NAME>-clone**

#### **--pod**=*name*

Clone the container in an existing pod.  It is helpful to move a container to an
existing pod.  The container will join the pod shared namespaces, losing its configuration
that conflicts with the shared namespaces.

#### **--run**

When set to true, this flag runs the newly created container after the
clone process has completed, this specifies a detached running mode.

## EXAMPLES
```
# podman container clone d0cf1f782e2ed67e8c0050ff92df865a039186237a4df24d7acba5b1fa8cc6e7
6b2c73ff8a1982828c9ae2092954bcd59836a131960f7e05221af9df5939c584
```

```
# podman container clone --name=clone d0cf1f782e2ed67e8c0050ff92df865a039186237a4df24d7acba5b1fa8cc6e7
6b2c73ff8a1982828c9ae2092954bcd59836a131960f7e05221af9df5939c584
```

```
# podman container clone --destroy --cpus=5 d0cf1f782e2ed67e8c0050ff92df865a039186237a4df24d7acba5b1fa8cc6e7
6b2c73ff8a1982828c9ae2092954bcd59836a131960f7e05221af9df5939c584
```

```
# podman container clone 2d4d4fca7219b4437e0d74fcdc272c4f031426a6eacd207372691207079551de new_name fedora
Resolved "fedora" as an alias (/etc/containers/registries.conf.d/shortnames.conf)
Trying to pull registry.fedoraproject.org/fedora:latest...
Getting image source signatures
Copying blob c6183d119aa8 done
Copying config e417cd49a8 done
Writing manifest to image destination
Storing signatures
5a9b7851013d326aa4ac4565726765901b3ecc01fcbc0f237bc7fd95588a24f9
```
## SEE ALSO
**[podman-create(1)](podman-create.1.md)**, **[cgroups(7)](https://man7.org/linux/man-pages/man7/cgroups.7.html)**

## HISTORY
January 2022, Originally written by Charlie Doern <cdoern@redhat.com>