Skip to content

Commit 7c95cea

Browse files
committed
Manpages: podman container runlabel added example with --replace
Signed-off-by: mohitjain1911 <[email protected]>
1 parent 43ea833 commit 7c95cea

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

docs/source/markdown/podman-container-runlabel.1.md.in

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,22 @@ Display the contents of the `run` label of image foobar.
7474
$ podman container runlabel --display run foobar
7575
```
7676

77+
Re-run a container using a label that sets a fixed container name. The --replace flag ensures any existing container is removed first.
78+
```
79+
$ podman ps -a
80+
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
81+
1254c038d892 docker.io/library/busybox:latest echo Hello from r... 26 seconds ago Exited (0) 26 seconds ago test-runlabel
82+
83+
$ podman container runlabel --replace RUN runlabel-test
84+
Hello from runlabel
85+
86+
$ podman ps -a
87+
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
88+
28efd9600d0c docker.io/library/busybox:latest echo Hello from r... 4 seconds ago Exited (0) 4 seconds ago test-runlabel
89+
90+
```
91+
This command is useful when the label uses a fixed name (e.g., `--name mycontainer`) and you want to repeatedly run it without manually removing the previous container.
92+
7793
## SEE ALSO
7894
**[podman(1)](podman.1.md)**, **[crun(1)](https://github.com/containers/crun/blob/main/crun.1.md)**, **[runc(8)](https://github.com/opencontainers/runc/blob/main/man/runc.8.md)**, **[containers-certs.d(5)](https://github.com/containers/image/blob/main/docs/containers-certs.d.5.md)**, **[containers-auth.json(5)](https://github.com/containers/image/blob/main/docs/containers-auth.json.5.md)**, **[containers-registries.conf(5)](https://github.com/containers/image/blob/main/docs/containers-registries.conf.5.md)**
7995

0 commit comments

Comments
 (0)