mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-10-15 02:17:43 +00:00
Podman 6 dropped cgroups v1 support, and the kernel real-time scheduler cgroup settings only exist on cgroups v1. That means the --cpu-rt-period and --cpu-rt-runtime options can never take effect anymore: on cgroups v2 the values only produce a warning and are discarded. As agreed in the linked issue, the full removal of the options is deferred to the next major release (7.0) to avoid a breaking change for anyone still setting them. For 6.x this commit implements the agreed interim step: - remove the option documentation (docs/source/markdown/options/ cpu-rt-period.md and cpu-rt-runtime.md) and drop the @@option references from the podman-create, podman-run, podman-update and podman-container-clone man pages - hide both flags from --help output - change the existing warning to state that the option is a NOP, that the value is ignored, and that the option will be removed in the next major release The e2e tests are updated to match the new warning text. Actual removal of the flags and the spec fields is left for Podman 7.0. Part of #29750 Signed-off-by: seonghun lee <harrisleesh@gmail.com>
125 lines
4 KiB
Markdown
125 lines
4 KiB
Markdown
% podman-container-clone 1
|
|
|
|
## NAME
|
|
podman\-container\-clone - Create 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-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
|
|
|
|
@@option device-read-bps
|
|
|
|
@@option device-write-bps
|
|
|
|
#### **--force**, **-f**
|
|
|
|
Force removal of the original container that we are cloning. Can only be used in conjunction with **--destroy**.
|
|
|
|
@@option memory
|
|
|
|
If no memory limits are specified, the original container's memory limits are used.
|
|
|
|
@@option memory-reservation
|
|
|
|
If unspecified, memory reservation is the same as memory limit from the
|
|
container being cloned.
|
|
|
|
@@option memory-swap
|
|
|
|
If unspecified, the container being cloned is used to derive
|
|
the swap value.
|
|
|
|
@@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 joins 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
|
|
|
|
Clone specified container into a new container:
|
|
```
|
|
# podman container clone d0cf1f782e2ed67e8c0050ff92df865a039186237a4df24d7acba5b1fa8cc6e7
|
|
6b2c73ff8a1982828c9ae2092954bcd59836a131960f7e05221af9df5939c584
|
|
```
|
|
|
|
Clone specified container into a newly named container:
|
|
```
|
|
# podman container clone --name=clone d0cf1f782e2ed67e8c0050ff92df865a039186237a4df24d7acba5b1fa8cc6e7
|
|
6b2c73ff8a1982828c9ae2092954bcd59836a131960f7e05221af9df5939c584
|
|
```
|
|
|
|
Replace specified container with selected resource constraints into a new container, removing original container:
|
|
```
|
|
# podman container clone --destroy --cpus=5 d0cf1f782e2ed67e8c0050ff92df865a039186237a4df24d7acba5b1fa8cc6e7
|
|
6b2c73ff8a1982828c9ae2092954bcd59836a131960f7e05221af9df5939c584
|
|
```
|
|
|
|
Clone specified container giving a new name and then replacing the image of the original container with the specified image name:
|
|
```
|
|
# 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>
|