Container Parameters¶
-
setup
¶ List of steps that is executed to build container. See Container Building Guide and Build Steps (The Reference) for more info.
-
environ-file
¶ The file with environment definitions. Path inside the container. The file consists of line per value, where key and value delimited by equals
=
sign. (Its similar to/etc/environment
in ubuntu orEnvironmentFile
in systemd, but doesn’t support commands quoting and line wrapping yet)
-
environ
¶ The mapping, that constitutes environment variables set in container. This overrides
environ-file
on value by value basis.
-
uids
¶ List of ranges of user ids that need to be mapped when the container runs. User must have some ranges in
/etc/subuid
to run this container, and the total size of all allowed ranges must be larger or equal to the sum of sizes of all the ranges specified inuids
parameter. Currently vagga applies ranges found in/etc/subuid
one by one until all ranges are satisfied. It’s not always optimal or desirable, we will allow to customize mapping in later versions.Default value is
[0-65535]
which is usually good enough. Unless you have a smaller number of uids available or run container in container.
-
gids
¶ List of ranges of group ids that need to be mapped when the container runs. User must have some ranges in
/etc/subgid
to run this container, and the total size of all allowed ranges must be larger or equal to the sum of sizes of all the ranges specified ingids
parameter. Currently vagga applies ranges found in/etc/subgid
one by one until all ranges are satisfied. It’s not always optimal or desirable, we will allow to customize mapping in later versions.Default value is
[0-65535]
which is usually good enough. Unless you have a smaller number of gids available or run container in container.
-
volumes
¶ The mapping of mount points to the definition of volume. Allows to mount some additional filesystems inside the container. See Volumes for more info. Default is:
volumes: /tmp: !Tmpfs { size: 100Mi, mode: 0o1777 }
Note
You must create a folder for each volume. See Container Building Guide for documentation.
-
resolv-conf-path
¶ The path in container where to copy
resolv.conf
from host. If the value isnull
, no file is copied. Default is/etc/resolv.conf
. Its useful if you symlink/etc/resolv.conf
to some tmpfs directory insetup
and pointresolv-conf-path
to the directory.Note
The default behavior for vagga is to overwrite
/etc/resolv.conf
inside the container at the start. It’s violation of read-only nature of container images (and visible for all containers). But as we are doing only single-machine development environments, it’s bearable. We are seeking for a better way without too much hassle for the user. But you can use the symlink if it bothers you.
-
hosts-file-path
¶ The path in container where to copy
/ets/hosts
from host. If the value isnull
, no file is copied. Default is/etc/hosts
. The setting intention is very similar toresolv-conf-path
, so the same considerations must be applied.
-
auto-clean
¶ (experimental) Do not leave multiple versions of the container lying around. Removes the old container version after the new one is successfully build. This is mostly useful for containers which depend on binaries locally built (i.e. the ones that are never reproduced in future because of timestamp). For most containers it’s a bad idea because it doesn’t allow to switch between branches using source-control quickly. Better use
vagga _clean --old
if possible.
-
image-cache-url
¶ If there is no locally cached image and it is going to be built, first check for the cached image in the specified URL.
Example:
image-cache-url: http://example.org/${container_name}.${short_hash}.tar.xz
To find out how to upload an image see
push-image-cmd
.Warning
The url must contain at least ${short_hash} substitution, or otherwise it will ruin the vagga’s container versioning.
Note
Similarly to
Tar
command we allow paths starting with . and /volumes/ here. It’s of limited usage. And we still consider this experimental. This may be useful for keeping image cache on network file system, presumably on non-public projects.
-
data-dirs
¶ List of directories and files that only should remain in the container. All other directories and files will be removed after container is build. Useful to create data containers that can be used as volumes inside normal containers.
Example:
data-dirs: [/var/lib/postgres]
-
default-shell
¶ (default
[/bin/sh, -c, $cmdline, "--"]
) Alternative shell to run commands with. This shell is only used to run commands which haverun
argument as a string. Ifrun
is a list then default shell is not used.You can use any command, not only sh-compatible, for example
python
, but that may be unexpected o user so use your best judgement. Also take closer look on the default invocation, in particular:$cmdline
is replaced with the contents ofrun
--
is a common convention to prevent user command’s arguments- conflicting with shell’s arguments (this is useful if
accepts-arguments
is enabled)