1ATOMIC(1) January 2015 ATOMIC(1)
2
3
4
6 atomic-run - Execute container image run method
7
8
9
11 atomic run [-h|--help] [--display] [-n][--name[=NAME]] [-r, --replace]
12 [--spc] [--storage] [--set=NAME=VALUE] [--quiet] IMAGE [COMMAND]
13 [ARG...]
14
15
16
18 atomic run attempts to start an existing container or run a container
19 from an image, first reading the LABEL RUN field in the container
20 IMAGE.
21
22
23 If the container image has a LABEL RUN instruction like the following:
24
25
26 LABEL RUN /usr/bin/docker run -t -i --rm \${OPT1} --cap-add=SYS_ADMIN
27 --net=host -v \${LOGDIR}:/var/log -v \${DATADIR}:/var/lib --name
28 \${NAME} \${IMAGE} \${OPT2} run.sh \${OPT3}
29
30
31 atomic run will run the following:
32
33
34 /usr/bin/docker run -t -i --rm --cap-add=SYS_ADMIN --net=host -v
35 ${LOGDIR}:/var/log -v ${DATADIR}:/var/lib --name ${NAME} ${IMAGE}
36 run.sh
37
38
39 If this field does not exist, atomic run defaults to the following:
40
41
42 /usr/bin/docker run -t -i --rm -v ${LOGDIR}:/var/log -v
43 ${DATADIR}:/var/lib --name ${NAME} ${IMAGE}
44
45
46 These defaults are suggested values for your container images.
47
48
49 atomic run will set the following environment variables for use in the
50 command:
51
52
53 NAME
54 The name specified via the command. NAME will be replaced with IMAGE
55 if it is not specified.
56
57
58 IMAGE
59 The name and image specified via the command.
60
61
62 OPT1, OPT2, OPT3
63 Additional options which can be specified via the command.
64
65
66 SUDO_UID
67 The SUDO_UID environment variable. This is useful with the docker -u
68 option for user space tools. If the environment variable is not
69 available, the value of /proc/self/loginuid is used.
70
71
72 SUDO_GID
73 The SUDO_GID environment variable. This is useful with the docker -u
74 option for user space tools. If the environment variable is not
75 available, the default GID of the value for SUDO_UID is used. If this
76 value is not available, the value of /proc/self/loginuid is used.
77
78
79 RUN_OPTS
80 Content of file specified by LABEL RUN_OPTS_FILE. During atomic
81 install, the install.sh can populate the file with any additional
82 options that need to be passed to docker run, for example
83 --hostname=www.example.test or --net host. The file name undergoes
84 environment variable expansion, so for example LABEL RUN_OPTS_FILE
85 '/var/lib/${NAME}/docker-run-opts' can be used to store per-container
86 configuration.
87
88
89 Custom environment variables can be provided to the container through
90 the LABEL RUN instruction as follows:
91
92
93 LABEL RUN /usr/bin/docker run -t -i --rm -e FOO="\${FOO:-bar}" -v
94 \${LOGDIR}:/var/log -v \${DATADIR}:/var/lib --name \${NAME} \${IMAGE}
95
96
97 atomic run will run the following:
98
99
100 /usr/bin/docker run -t -i --rm -e FOO="${FOO:-bar}" -v
101 ${LOGDIR}:/var/log -v ${DATADIR}:/var/lib --name ${NAME} ${IMAGE}
102
103
104 The value of FOO can be set explicitly via FOO=baz atomic run.
105
106
107
109 -h --help
110 Print usage statement
111
112
113 --display
114 Display the image's run options and environment variables populated
115 into the run command. The run command will not execute if --display is
116 specified. If --display is not specified the run command will execute.
117
118
119 --n --name=""
120 Use this name for creating run content for the container. NAME will
121 default to the IMAGENAME if it is not specified.
122
123
124 -r --replace
125 Replaces an existing container by the same name if it exists prior
126 to running.
127
128
129 --runtime=PATH
130 Change the OCI runtime used by the systemd service file for running
131 system containers and user containers. If runtime is not defined,
132 the
133 value runtime in the configuration file is used for system
134 containers. If there is no runtime defined in the configuration
135 file
136 as well, then the default /usr/bin/runc is used.
137
138
139 --spc
140 Run container in super privileged container mode. The image will run
141 with the following command:
142
143
144 /usr/bin/docker run -t -i --rm --privileged -v /:/host -v /run:/run
145 --net=host --ipc=host --pid=host -e HOST=/host -e NAME=${NAME} -e
146 IMAGE=${IMAGE} --name ${NAME} ${IMAGE}
147
148
149 --storage
150 Allows you to override the default definition for the storage
151 backend where your image will reside if pulled. If the image is
152 already local, the --storage option will dictate where atomic should
153 look for the image prior to running. Valid options are docker and
154 ostree.
155
156
157 --set=NAME=VALUE Set a value that is going to be used by a system
158 container for its configuration and can be specified multiple times.
159 It is used only by --system. OSTree is required for this feature to be
160 available.
161
162
163 --quiet
164 Run without verbose messaging (i.e. security warnings).
165
166
167
169 January 2015, Originally compiled by Daniel Walsh (dwalsh at redhat dot
170 com) July 2015, edited by Sally O'Malley (somalley at redhat dot com)
171
172
173
174Dan Walsh Atomic Man Pages ATOMIC(1)