2015-01-23 04:48:36 -05:00
|
|
|
% ATOMIC(1) Atomic Man Pages
|
|
|
|
|
% Dan Walsh
|
|
|
|
|
% January 2015
|
|
|
|
|
# NAME
|
|
|
|
|
atomic-install - Execute Image Install Method
|
|
|
|
|
|
|
|
|
|
# SYNOPSIS
|
|
|
|
|
**atomic install**
|
2015-08-26 07:22:08 -04:00
|
|
|
[**-h**|**--help**]
|
2015-07-14 17:04:40 -04:00
|
|
|
[**--display**]
|
2015-08-30 09:57:04 -04:00
|
|
|
[**-n**][**--name**[=*NAME*]]
|
2016-08-12 16:52:08 +00:00
|
|
|
[**--rootfs**=*ROOTFS*]
|
2016-04-07 17:07:24 +02:00
|
|
|
[**--set**=*NAME*=*VALUE*]
|
2017-02-02 10:51:46 -06:00
|
|
|
[**--storage**]
|
2017-03-06 12:46:17 +01:00
|
|
|
[**--system-package=auto|build|yes|no**]
|
2016-04-07 17:07:24 +02:00
|
|
|
[**--system**]
|
2015-05-27 09:21:55 -04:00
|
|
|
IMAGE [ARG...]
|
2015-01-23 04:48:36 -05:00
|
|
|
|
|
|
|
|
# DESCRIPTION
|
|
|
|
|
**atomic install** attempts to read the `LABEL INSTALL` field in the container
|
2015-08-26 07:22:08 -04:00
|
|
|
IMAGE, if this field does not exist, `atomic install` will install the IMAGE.
|
2015-01-23 04:48:36 -05:00
|
|
|
|
2015-02-23 17:31:28 -05:00
|
|
|
If the container image has a LABEL INSTALL instruction like the following:
|
2015-01-23 04:48:36 -05:00
|
|
|
|
2015-09-14 09:14:57 -04:00
|
|
|
`LABEL INSTALL /usr/bin/docker 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}`
|
2015-01-23 04:48:36 -05:00
|
|
|
|
2015-06-18 12:58:22 +02:00
|
|
|
`atomic install` will set the following environment variables for use in the command:
|
|
|
|
|
|
|
|
|
|
**NAME**
|
2016-07-15 15:17:16 +02:00
|
|
|
The name specified via the command. NAME will be replaced with IMAGE if it is not specified.
|
2015-06-18 12:58:22 +02:00
|
|
|
|
|
|
|
|
**IMAGE**
|
2016-07-15 15:17:16 +02:00
|
|
|
The name and image specified via the command.
|
2015-06-18 12:58:22 +02:00
|
|
|
|
2015-06-17 00:56:36 +05:30
|
|
|
**OPT1, OPT2, OPT3**
|
2016-07-15 15:17:16 +02:00
|
|
|
Additional options which can be specified via the command.
|
2015-06-17 00:56:36 +05:30
|
|
|
|
2015-06-18 12:58:22 +02:00
|
|
|
**SUDO_UID**
|
2016-07-15 15:17:16 +02:00
|
|
|
The `SUDO_UID` environment variable. This is useful with the docker
|
|
|
|
|
`-u` option for user space tools. If the environment variable is
|
|
|
|
|
not available, the value of `/proc/self/loginuid` is used.
|
2015-06-18 12:58:22 +02:00
|
|
|
|
|
|
|
|
**SUDO_GID**
|
2016-07-15 15:17:16 +02:00
|
|
|
The `SUDO_GID` environment variable. This is useful with the docker
|
|
|
|
|
`-u` option for user space tools. If the environment variable is
|
|
|
|
|
not available, the default GID of the value for `SUDO_UID` is used.
|
|
|
|
|
If this value is not available, the value of `/proc/self/loginuid`
|
|
|
|
|
is used.
|
2015-06-18 12:58:22 +02:00
|
|
|
|
2015-09-14 09:14:57 -04:00
|
|
|
Any additional arguments will be appended to the command.
|
2015-01-23 04:48:36 -05:00
|
|
|
|
|
|
|
|
# OPTIONS:
|
2015-08-26 07:22:08 -04:00
|
|
|
**-h** **--help**
|
2016-07-15 15:17:16 +02:00
|
|
|
Print usage statement
|
2015-01-23 04:48:36 -05:00
|
|
|
|
2015-07-14 17:04:40 -04:00
|
|
|
**--display**
|
2016-07-15 15:17:16 +02:00
|
|
|
Display the image's install options and environment variables
|
|
|
|
|
populated into the install command.
|
2015-07-14 17:04:40 -04:00
|
|
|
The install command will not execute if --display is specified.
|
|
|
|
|
If --display is not specified the install command will execute.
|
|
|
|
|
|
2015-08-30 09:57:04 -04:00
|
|
|
**-n** **--name**=""
|
2016-07-15 15:17:16 +02:00
|
|
|
Use this name for creating installed content for the container.
|
|
|
|
|
NAME will default to the IMAGENAME if it is not specified.
|
2015-01-23 04:48:36 -05:00
|
|
|
|
2016-08-12 16:52:08 +00:00
|
|
|
**--rootfs=ROOTFS**
|
|
|
|
|
Specify a ROOTFS folder, which can be an existing, expanded
|
|
|
|
|
container/image, or a location which contains an existing
|
|
|
|
|
root filesystem. The existing rootfs will be used as the new
|
|
|
|
|
system container's rootfs (read only), and thus the new container
|
|
|
|
|
will only contain config and info files.
|
|
|
|
|
|
2017-11-07 17:01:05 +01:00
|
|
|
**--runtime=PATH**
|
|
|
|
|
Change the OCI runtime used by the systemd service file for running
|
2017-11-07 17:06:40 +01:00
|
|
|
system containers and user containers. If runtime is not defined, the
|
|
|
|
|
value **runtime** in the configuration file is used for system
|
|
|
|
|
containers. If there is no runtime defined in the configuration file
|
2018-04-15 12:07:07 +02:00
|
|
|
as well, then the default **/usr/bin/runc** is used.
|
2017-11-07 17:01:05 +01:00
|
|
|
|
2016-04-07 17:07:24 +02:00
|
|
|
**--set=NAME=VALUE**
|
2016-07-15 15:17:16 +02:00
|
|
|
Set a value that is going to be used by a system container for its
|
|
|
|
|
configuration and can be specified multiple times. It is used only
|
|
|
|
|
by --system. OSTree is required for this feature to be available.
|
2016-04-07 17:07:24 +02:00
|
|
|
|
2017-02-02 10:51:46 -06:00
|
|
|
**--storage**
|
|
|
|
|
Allows you to override the default definition for the storage backend
|
|
|
|
|
where your image will reside if pulled. If the image is already local,
|
|
|
|
|
the --storage option will dictate where atomic should look for the image
|
|
|
|
|
prior to installing. Valid options are `docker` and `ostree`.
|
|
|
|
|
|
2017-04-26 19:02:45 +02:00
|
|
|
If you are installing a container using `docker` storage, you may define a
|
|
|
|
|
label in your image named `atomic.has_install_files`. This label indicates
|
|
|
|
|
there are files inside the container image which are meant to be placed on host
|
|
|
|
|
system. An rpm is created from these files and installed onto host system.
|
|
|
|
|
|
2016-04-07 17:07:24 +02:00
|
|
|
**--system**
|
2016-07-15 15:17:16 +02:00
|
|
|
Install a system container. A system container is a container that
|
|
|
|
|
is executed out of an systemd unit file early in boot, using runc.
|
2016-08-29 11:23:58 +02:00
|
|
|
The specified **IMAGE** must be a system image already fetched. If it
|
|
|
|
|
is not already present, atomic will attempt to fetch it assuming it is
|
|
|
|
|
an `oci` image. For more information on how images are fetched, see
|
|
|
|
|
also **atomic-pull(1)**.
|
2016-07-15 15:17:16 +02:00
|
|
|
Installing a system container consists of checking it the image by
|
|
|
|
|
default under /var/lib/containers/atomic/ and generating the
|
|
|
|
|
configuration files for runc and systemd.
|
2016-08-29 11:23:58 +02:00
|
|
|
OSTree and runc are required for this feature to be available.
|
2016-04-07 17:07:24 +02:00
|
|
|
|
2017-02-02 10:51:46 -06:00
|
|
|
Note: If the image being pulled contains a label of `system.type=ostree`,
|
|
|
|
|
atomic will automatically substitute the storage backend to be ostree. This
|
|
|
|
|
can be overridden with the --storage option.
|
|
|
|
|
|
2017-10-26 14:31:22 +02:00
|
|
|
The system container template files support substition of variables.
|
|
|
|
|
|
|
|
|
|
These files in the image are managed as metadata for system
|
|
|
|
|
containers:
|
|
|
|
|
|
|
|
|
|
**/exports/config.json.template** The OCI configuration for running
|
|
|
|
|
the container. The generated file is ultimately used by the OCI
|
|
|
|
|
runtime for setting up the container.
|
|
|
|
|
|
|
|
|
|
**/exports/manifest.json** Various settings for the container.
|
|
|
|
|
|
|
|
|
|
**/exports/service.template** Template for the systemd unit file.
|
|
|
|
|
|
|
|
|
|
**/exports/tmpfiles.template** Template for systemd-tmpfiles, if the
|
|
|
|
|
container needs temporary files on the system.
|
|
|
|
|
|
|
|
|
|
In **/exports/manifest.json** it is possible to setup these settings:
|
|
|
|
|
|
|
|
|
|
**defaultValues** A dictionary which containers the default values
|
|
|
|
|
given to variables used by the template files. The user can override
|
|
|
|
|
these values with **-set=VARIABLE=NEWVALUE**.
|
|
|
|
|
|
|
|
|
|
**installedFilesTemplate** List of files that must be preprocessed
|
|
|
|
|
before being copied to the host.
|
|
|
|
|
|
|
|
|
|
**noContainerService** Set to True if the container is used only for
|
|
|
|
|
copying files to the host but has not a systemd service.
|
|
|
|
|
|
|
|
|
|
**renameFiles** Define the destination name of the files on the host.
|
|
|
|
|
Variable sobstitution is supported so that it is possible to use
|
|
|
|
|
variables to compose the final destination path.
|
|
|
|
|
|
|
|
|
|
Every file under **/exports/hostfs** is copied to the host when the
|
|
|
|
|
container is installed, and removed once the container is
|
|
|
|
|
uninstalled.
|
|
|
|
|
For instance, a file **/exports/hostfs/usr/local/bin/foo** in the
|
|
|
|
|
image is copied to the host as **/usr/local/bin/foo**.
|
|
|
|
|
The directives **installedFilesTemplate** and **renameFiles** from the
|
|
|
|
|
**manifest.json** file can be used to modify the content and the final
|
|
|
|
|
destination of the file.
|
|
|
|
|
|
2018-01-19 13:20:41 +01:00
|
|
|
**useLinks** Specify if files copied to the host under */usr* should use
|
|
|
|
|
hard links when possible. By default it is True.
|
|
|
|
|
|
2017-10-26 14:31:22 +02:00
|
|
|
This is the list of the variables that get a value from atomic and
|
|
|
|
|
cannot be overriden by the user through **--set**:
|
|
|
|
|
|
|
|
|
|
**$DESTDIR** Destination on the file system for the checked out
|
|
|
|
|
container.
|
|
|
|
|
|
|
|
|
|
**$EXEC_STARTPRE** Command to use for the systemd directive ExecStartPre=.
|
|
|
|
|
|
|
|
|
|
**$EXEC_START** Command to use for the systemd directive ExecStart=.
|
|
|
|
|
|
|
|
|
|
**$EXEC_STOP** Command to use for the systemd directive ExecStop=.
|
|
|
|
|
|
|
|
|
|
**$EXEC_STOPPOST** Command to use for the systemd directive ExecStopPost=.
|
|
|
|
|
|
|
|
|
|
**$HOST_UID** UID of the user on the system.
|
|
|
|
|
|
|
|
|
|
**$HOST_GID** GID of the user on the system.
|
|
|
|
|
|
|
|
|
|
**$IMAGE_ID** ID of the image being installed.
|
|
|
|
|
|
|
|
|
|
**$IMAGE_NAME** Name of the image being installed.
|
|
|
|
|
|
|
|
|
|
**$NAME** Name of the container.
|
|
|
|
|
|
|
|
|
|
Some other variables get a value but it is possible to override it
|
|
|
|
|
through **--set**:
|
|
|
|
|
|
|
|
|
|
**$ALL_PROCESS_CAPABILITIES** A list of all the kernel process
|
|
|
|
|
capabilities available on the system, in the format expected in the
|
|
|
|
|
OCI configuration file.
|
|
|
|
|
Privileged containers that keep all capabilities should use this
|
|
|
|
|
variable instead of hardcoding the list. This simplifies the
|
|
|
|
|
configuration file as well as improve images portability as the same
|
|
|
|
|
image can be used on systems with a different set of capabilities.
|
|
|
|
|
|
|
|
|
|
**$CONFIG_DIRECTORY** Directory where to store configuration files
|
|
|
|
|
(/etc on the host, ~/.config/ for user containers).
|
|
|
|
|
|
|
|
|
|
**$PIDFILE** File where to store the PID of the container main
|
|
|
|
|
process.
|
|
|
|
|
|
|
|
|
|
**$RUN_DIRECTORY** Directory where to store runtime files. (/run on
|
|
|
|
|
the host, $XDG_RUNTIME_DIR for user containers).
|
|
|
|
|
|
|
|
|
|
**$STATE_DIRECTORY** Directory where to store the state of the container.
|
|
|
|
|
|
|
|
|
|
**$UUID** UUID generated for this container.
|
|
|
|
|
|
2017-12-04 19:33:51 +01:00
|
|
|
**$RUNTIME** The runtime used to execute the containers.
|
|
|
|
|
|
2017-12-04 19:59:55 +01:00
|
|
|
**$ATOMIC** Path to the atomic executable that is installing the container.
|
|
|
|
|
|
2017-03-06 12:46:17 +01:00
|
|
|
**--system-package=auto|build|no|yes**
|
|
|
|
|
Control how the container will be installed to the system.
|
|
|
|
|
|
|
|
|
|
*auto* generates an rpm and install it to the system when the
|
|
|
|
|
image defines a .spec file. This is the default.
|
|
|
|
|
|
|
|
|
|
*build* build only the software package, without installing it.
|
|
|
|
|
|
|
|
|
|
*no* do not generate an rpm package to install the container.
|
|
|
|
|
|
|
|
|
|
*yes* generate an rpm package and install it to the system.
|
|
|
|
|
|
2016-08-09 12:27:19 +02:00
|
|
|
**--user**
|
|
|
|
|
If running as non-root, specify to install the image from the current
|
2018-04-15 12:07:07 +02:00
|
|
|
OSTree repository and manage it through systemd and runc.
|
|
|
|
|
OSTree and runc are required for this feature to be available.
|
2017-10-26 14:31:22 +02:00
|
|
|
The same image format as for **--system** is supported. Please refer
|
|
|
|
|
to **--system** for more information.
|
2016-08-09 12:27:19 +02:00
|
|
|
|
2015-01-23 04:48:36 -05:00
|
|
|
# HISTORY
|
|
|
|
|
January 2015, Originally compiled by Daniel Walsh (dwalsh at redhat dot com)
|
2015-07-14 17:04:40 -04:00
|
|
|
July 2015, edited by Sally O'Malley (somalley at redhat dot com)
|
2017-10-26 14:31:22 +02:00
|
|
|
October 2017, edited by Giuseppe Scrivano (gscrivan at redhat dot com)
|