Skip to content
This repository was archived by the owner on Oct 10, 2020. It is now read-only.

Commit cd6af24

Browse files
giusepperh-atomic-bot
authored andcommitted
docs: document system container variables and files
This might not be the best place to add this information, but it is a starting point to get it documented. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com> Closes: #1121 Approved by: baude
1 parent 30c9504 commit cd6af24

1 file changed

Lines changed: 92 additions & 0 deletions

File tree

docs/atomic-install.1.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,95 @@ Note: If the image being pulled contains a label of `system.type=ostree`,
102102
atomic will automatically substitute the storage backend to be ostree. This
103103
can be overridden with the --storage option.
104104

105+
The system container template files support substition of variables.
106+
107+
These files in the image are managed as metadata for system
108+
containers:
109+
110+
**/exports/config.json.template** The OCI configuration for running
111+
the container. The generated file is ultimately used by the OCI
112+
runtime for setting up the container.
113+
114+
**/exports/manifest.json** Various settings for the container.
115+
116+
**/exports/service.template** Template for the systemd unit file.
117+
118+
**/exports/tmpfiles.template** Template for systemd-tmpfiles, if the
119+
container needs temporary files on the system.
120+
121+
In **/exports/manifest.json** it is possible to setup these settings:
122+
123+
**defaultValues** A dictionary which containers the default values
124+
given to variables used by the template files. The user can override
125+
these values with **-set=VARIABLE=NEWVALUE**.
126+
127+
**installedFilesTemplate** List of files that must be preprocessed
128+
before being copied to the host.
129+
130+
**noContainerService** Set to True if the container is used only for
131+
copying files to the host but has not a systemd service.
132+
133+
**renameFiles** Define the destination name of the files on the host.
134+
Variable sobstitution is supported so that it is possible to use
135+
variables to compose the final destination path.
136+
137+
Every file under **/exports/hostfs** is copied to the host when the
138+
container is installed, and removed once the container is
139+
uninstalled.
140+
For instance, a file **/exports/hostfs/usr/local/bin/foo** in the
141+
image is copied to the host as **/usr/local/bin/foo**.
142+
The directives **installedFilesTemplate** and **renameFiles** from the
143+
**manifest.json** file can be used to modify the content and the final
144+
destination of the file.
145+
146+
This is the list of the variables that get a value from atomic and
147+
cannot be overriden by the user through **--set**:
148+
149+
**$DESTDIR** Destination on the file system for the checked out
150+
container.
151+
152+
**$EXEC_STARTPRE** Command to use for the systemd directive ExecStartPre=.
153+
154+
**$EXEC_START** Command to use for the systemd directive ExecStart=.
155+
156+
**$EXEC_STOP** Command to use for the systemd directive ExecStop=.
157+
158+
**$EXEC_STOPPOST** Command to use for the systemd directive ExecStopPost=.
159+
160+
**$HOST_UID** UID of the user on the system.
161+
162+
**$HOST_GID** GID of the user on the system.
163+
164+
**$IMAGE_ID** ID of the image being installed.
165+
166+
**$IMAGE_NAME** Name of the image being installed.
167+
168+
**$NAME** Name of the container.
169+
170+
Some other variables get a value but it is possible to override it
171+
through **--set**:
172+
173+
**$ALL_PROCESS_CAPABILITIES** A list of all the kernel process
174+
capabilities available on the system, in the format expected in the
175+
OCI configuration file.
176+
Privileged containers that keep all capabilities should use this
177+
variable instead of hardcoding the list. This simplifies the
178+
configuration file as well as improve images portability as the same
179+
image can be used on systems with a different set of capabilities.
180+
181+
**$CONFIG_DIRECTORY** Directory where to store configuration files
182+
(/etc on the host, ~/.config/ for user containers).
183+
184+
**$PIDFILE** File where to store the PID of the container main
185+
process.
186+
187+
**$RUN_DIRECTORY** Directory where to store runtime files. (/run on
188+
the host, $XDG_RUNTIME_DIR for user containers).
189+
190+
**$STATE_DIRECTORY** Directory where to store the state of the container.
191+
192+
**$UUID** UUID generated for this container.
193+
105194
**--system-package=auto|build|no|yes**
106195
Control how the container will be installed to the system.
107196

@@ -118,7 +207,10 @@ image defines a .spec file. This is the default.
118207
If running as non-root, specify to install the image from the current
119208
OSTree repository and manage it through systemd and bubblewrap.
120209
OSTree and bwrap-oci are required for this feature to be available.
210+
The same image format as for **--system** is supported. Please refer
211+
to **--system** for more information.
121212

122213
# HISTORY
123214
January 2015, Originally compiled by Daniel Walsh (dwalsh at redhat dot com)
124215
July 2015, edited by Sally O'Malley (somalley at redhat dot com)
216+
October 2017, edited by Giuseppe Scrivano (gscrivan at redhat dot com)

0 commit comments

Comments
 (0)