github.com/containers/podman/v2@v2.2.2-0.20210501105131-c1e07d070c4c/docs/source/markdown/podman-container-runlabel.1.md (about) 1 % podman-container-runlabel(1) 2 3 ## NAME 4 podman-container-runlabel - Executes a command as described by a container image label 5 6 ## SYNOPSIS 7 **podman container runlabel** [*options*] *label* *image* [*arg...*] 8 9 ## DESCRIPTION 10 **podman container runlabel** reads the provided `LABEL` field in the container 11 IMAGE and executes the provided value for the label as a command. If this field does not 12 exist, `podman container runlabel` will just exit. 13 14 If the container image has a LABEL INSTALL instruction like the following: 15 16 `LABEL INSTALL /usr/bin/podman run -t -i --rm \${OPT1} --privileged -v /:/host --net=host --ipc=host --pid=host -e HOST=/host -e NAME=\${NAME} -e IMAGE=\${IMAGE} -e CONFDIR=\/etc/${NAME} -e LOGDIR=/var/log/\${NAME} -e DATADIR=/var/lib/\${NAME} \${IMAGE} \${OPT2} /bin/install.sh \${OPT3}` 17 18 `podman container runlabel` will set the following environment variables for use in the command: 19 20 If the container image does not have the desired label, an error message will be displayed along with a non-zero 21 return code. If the image is not found in local storage, Podman will attempt to pull it first. 22 23 **LABEL** 24 The label name specified via the command. 25 26 **IMAGE** 27 Image name specified via the command. 28 29 **SUDO_UID** 30 The `SUDO_UID` environment variable. This is useful with the podman 31 `-u` option for user space tools. If the environment variable is 32 not available, the value of `/proc/self/loginuid` is used. 33 34 **SUDO_GID** 35 The `SUDO_GID` environment variable. This is useful with the podman 36 `-u` option for user space tools. If the environment variable is 37 not available, the default GID of the value for `SUDO_UID` is used. 38 If this value is not available, the value of `/proc/self/loginuid` 39 is used. 40 41 Any additional arguments will be appended to the command. 42 43 ## OPTIONS 44 #### **--authfile**=*path* 45 46 Path of the authentication file. Default is ${XDG\_RUNTIME\_DIR}/containers/auth.json, which is set using `podman login`. 47 If the authorization state is not found there, $HOME/.docker/config.json is checked, which is set using `docker login`. 48 49 Note: You can also override the default path of the authentication file by setting the REGISTRY\_AUTH\_FILE 50 environment variable. `export REGISTRY_AUTH_FILE=path` 51 52 #### **--display** 53 54 Display the label's value of the image having populated its environment variables. 55 The runlabel command will not execute if --display is specified. 56 57 #### **--cert-dir**=*path* 58 59 Use certificates at *path* (\*.crt, \*.cert, \*.key) to connect to the registry. 60 Default certificates directory is _/etc/containers/certs.d_. (Not available for remote commands) 61 62 #### **--creds**=*[username[:password]]* 63 64 The [username[:password]] to use to authenticate with the registry if required. 65 If one or both values are not supplied, a command line prompt will appear and the 66 value can be entered. The password is entered without echo. 67 68 #### **--help**, **-h** 69 Print usage statement 70 71 #### **--name**, **-n**=*name* 72 73 Use this name for creating content for the container. NAME will default to the IMAGENAME if it is not specified. 74 75 #### **--quiet**, **-q** 76 77 Suppress output information when pulling images 78 79 #### **--replace** 80 81 If a container exists of the default or given name, as needed it will be stopped, deleted and a new container will be 82 created from this image. 83 84 #### **--tls-verify** 85 86 Require HTTPS and verify certificates when contacting registries (default: true). If explicitly set to true, 87 then TLS verification will be used. If set to false, then TLS verification will not be used. If not specified, 88 TLS verification will be used unless the target registry is listed as an insecure registry in registries.conf. 89 90 ## EXAMPLES 91 92 Execute the run label of an image called foobar. 93 ``` 94 $ sudo podman container runlabel run foobar 95 ``` 96 97 Execute the install label of an image called foobar with additional arguments. 98 ``` 99 $ sudo podman container runlabel install foobar apples oranges 100 ``` 101 102 Display the command that would be executed by runlabel. 103 ``` 104 $ sudo podman container runlabel --display run foobar 105 ``` 106 107 ## SEE ALSO 108 podman(1) 109 110 ## HISTORY 111 September 2018, Originally compiled by Brent Baude (bbaude at redhat dot com)