podman-con...er-runlabel(1)
π podman-container-runlabel β the manual page, but make it cute π
okay so you're reading the General Commands Manual page for podman-container-runlabel, and bestie, this one is a whole vibe. Let's get into it. β¨
β¨ NAME β¨
podman-container-runlabel β execute a command as described by a container-image label. that's it, that's the whole job. π
π¦ SYNOPSIS π¦
podman container runlabel [options] label image [arg...]
πΈ DESCRIPTION πΈ
okay so here's the tea: podman container runlabel reads the label you asked for off the image, and then executes it as a command on the host. If that label doesn't exist? Podman just exits with an error, no drama, no mercy. π And any extra arguments you tack on get appended to the command. slay.
so, history lesson but make it fun π§: container images have always described the contents (like, the layers) and how a container runtime (think crun(1) or runc(1)) executes the container. Like, an image can set the environment and the command in its config. but β and this is the plot twist β a container image cannot directly specify how a container engine like Podman executes it. an image config has zero info about log drivers, namespaces, or which capabilities it needs to run correctly. it's giving "i have no idea what i want." π
podman container runlabel fixes that limitation in a simple yet efficient way. Podman reads the label's contents and interprets it as a command that gets executed on the host. so the image itself gets to describe exactly how Podman runs it. for instance, a label with the content:
/usr/bin/podman run -d --pid=host --privileged \${IMAGE}
instructs that the image be executed in a detached, privileged container using the PID namespace of the host. iconic. this lifts the self-description of a container image from "what" to "how". main character energy fr fr. π
bestie, listen. the runlabel command is intended to be run in trusted environments exclusively. using it on untrusted images is not recommended. no cap. do not do it. π
π VARIABLES π
the contents of a label can refer to these variables, which get substituted while the label is being processed. π«
IMAGEβ the name of the image. when you runpodman container runlabel label fedora, theIMAGEvariable gets replaced withfedora. valid formats areIMAGE,$IMAGE,${IMAGE}and=IMAGE.NAMEβ as specified by the--nameoption. the format is identical to the one of theIMAGEattribute.PWDβ gets replaced with the current working directory.
π OPTIONS π
--authfile=path β path of the authentication file. default is${XDG_RUNTIME_DIR}/containers/auth.jsonon Linux, and$HOME/.config/containers/auth.jsonon Windows/macOS. this file is created bypodman login. if the authorization state isn't found there,$HOME/.docker/config.jsongets checked, which is set usingdocker login.
note: there's also the option to override the default path of the authentication file by setting theREGISTRY_AUTH_FILEenvironment variable. you do that withexport REGISTRY_AUTH_FILE=path. π«Ά
--cert-dir=path β use certificates at path (*.crt,*.cert,*.key) to connect to the registry. (default:/etc/containers/certs.d) for details, seecontainers-certs.d(5). (this option is not available with the remote Podman client, including Mac and Windows (excluding WSL2) machines)--creds=[username[:password]]β the[username[:password]]to use to authenticate with the registry, if required. if one or both values are not supplied, a command line prompt appears and the value can be entered. the password is entered without echo. lowkey spooky but it's for your own good. π΅οΈ
note that the specified credentials are only used to authenticate against target registries. they are not used for mirrors or when the registry gets rewritten (see containers-registries.conf(5)); to authenticate against those, consider using a containers-auth.json(5) file. iykyk.
--displayβ display the label's value of the image, having populated its environment variables. therunlabelcommand is not executed if--displayis specified. it's just looking, not touching. π--help,-hβ print usage statement. classic.--name,-n=name β use this name for creating content for the container. if not specified, name defaults to the name of the image.--quiet,-qβ suppress output information when pulling images. shhh. π€«--replaceβ if a container exists with the current name, it is stopped, deleted and a new container is created from this image. out with the old, in with the new. β¨--tls-verifyβ require HTTPS and verify certificates when contacting registries (default:true). if explicitly set totrue, TLS verification is used. if set tofalse, TLS verification is not used. if not specified, TLS verification is used unless the target registry is listed as an insecure registry incontainers-registries.conf(5).
π EXAMPLES π
execute the run label of an image called foobar. π
$ podman container runlabel run foobar
execute the install label of an image called foobar with additional arguments.
$ podman container runlabel install foobar apples oranges
display the contents of the run label of image foobar. (just peeking, bestie π)
$ podman container runlabel --display run foobar
re-run a container using a label that sets a fixed container name. the --replace flag ensures any existing container is removed first.
$ podman ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1254c038d892 docker.io/library/busybox:latest echo Hello from r... 26 seconds ago Exited (0) 26 seconds ago test-runlabel
$ podman container runlabel --replace RUN runlabel-test
Hello from runlabel
$ podman ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
28efd9600d0c docker.io/library/busybox:latest echo Hello from r... 4 seconds ago Exited (0) 4 seconds ago test-runlabel
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. no manual cleanup era, we love to see it. π
π₯ SEE ALSO π₯
podman(1), crun(1), runc(8), containers-certs.d(5), containers-auth.json(5), containers-registries.conf(5)
π HISTORY π
- August 2021, Refinements by Valentin Rothberg (rothberg at redhat dot com)
- September 2018, Originally compiled by Brent Baude (bbaude at redhat dot com)
and that's the whole page, bestie!! π¦ the footer of this page is literally just the truncated manual name again β podman-con...er-runlabel(1) β sitting pretty at the bottom of the General Commands Manual, and honestly? it ate. go forth and run those labels, but only on images you trust. periodt. πβ¨π
π¦ where this page comes from
- arch rolling: podman-docker 6.1.4-1 Β· Apache-2.0
- fedora 43: podman-docker 5:5.8.4-1.fc43
- fedora 43: podman-docker 5:5.8.8-1.fc43
- fedora 43: podman-docker 5:5.8.9-1.fc43 Β· Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0
- fedora 44: podman-docker 5:5.8.1-1.fc44 Β· Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0
- fedora 44: podman-docker 5:5.8.7-1.fc44
- fedora 44: podman-docker 5:5.8.9-1.fc44 Β· Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0
- ubuntu resolute: podman-docker 5.7.0+ds2-3build1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms