22
33## Target image metadata
44
5- With dockerfiles, this is being usally done with instructions such as ` LABEL ` ,
6- ` ENV ` or ` EXPOSE ` . Bender supports two ways of configuring the metadata:
5+ With dockerfiles, this is being usually done with instructions such as ` LABEL ` ,
6+ ` ENV ` or ` EXPOSE ` . Bender supports two ways of configuring the metadata:
77
88* Setting specific Ansible variables inside your playbook.
99* CLI options of ` ansible-bender build ` .
1010
1111
1212### Via playbook vars
1313
14- ** This feature is present in git master only, it was not released yet.**
15-
1614Configuration is done using a top-level Ansible variable ` ansible_bender ` . All
1715the values are nested under it. The values are processed before a build starts.
1816The changes to values are not reflected during a playbook run.
@@ -51,6 +49,7 @@ only from the first play. All the plays will end up in a single container image.
5149| ----------------------| -----------------| ----------------------------------------------------------------------|
5250| ` name ` | string | name of the image |
5351| ` labels ` | dict | key/value data to apply to the final image |
52+ | ` annotations ` | dict | key/value data to apply to the final image (buildah/runc specific) |
5453| ` environment ` | dict | implicit environment variables to set in a container |
5554| ` cmd ` | string | a default command to invoke the container |
5655| ` user ` | string | UID or username used to invoke the container |
@@ -91,6 +90,24 @@ Please bear in mind that most of the facts won't be available.
9190Please check out ` ansible-bender build --help ` for up to date options:
9291
9392```
93+ $ ansible-bender build -h
94+ usage: ansible-bender build [-h] [--builder {docker,buildah}] [--no-cache]
95+ [--build-volumes [BUILD_VOLUMES [BUILD_VOLUMES ...]]]
96+ [-w WORKDIR] [-l [LABELS [LABELS ...]]]
97+ [--annotation [ANNOTATIONS [ANNOTATIONS ...]]]
98+ [-e [ENV_VARS [ENV_VARS ...]]] [--cmd CMD]
99+ [-u USER] [-p [PORTS [PORTS ...]]]
100+ [--runtime-volumes [RUNTIME_VOLUMES [RUNTIME_VOLUMES ...]]]
101+ [--extra-ansible-args EXTRA_ANSIBLE_ARGS]
102+ [--python-interpreter PYTHON_INTERPRETER]
103+ PLAYBOOK_PATH [BASE_IMAGE] [TARGET_IMAGE]
104+
105+ positional arguments:
106+ PLAYBOOK_PATH path to Ansible playbook
107+ BASE_IMAGE name of a container image to use as a base
108+ TARGET_IMAGE name of the built container image
109+
110+ optional arguments:
94111 -h, --help show this help message and exit
95112 --builder {docker,buildah}
96113 pick preferred builder backend
@@ -104,9 +121,11 @@ Please check out `ansible-bender build --help` for up to date options:
104121 '/host/dir:/container/dir'
105122 -w WORKDIR, --workdir WORKDIR
106123 path to an implicit working directory in the container
107- -l [LABELS [LABELS ...]], --labels [LABELS [LABELS ...]]
124+ -l [LABELS [LABELS ...]], --label [LABELS [LABELS ...]]
108125 add a label to the metadata of the image, should be
109126 specified as 'key=value'
127+ --annotation [ANNOTATIONS [ANNOTATIONS ...]]
128+ Add key=value annotation for the target image
110129 -e [ENV_VARS [ENV_VARS ...]], --env-vars [ENV_VARS [ENV_VARS ...]]
111130 add an environment variable to the metadata of the
112131 image, should be specified as 'KEY=VALUE'
@@ -122,4 +141,6 @@ Please check out `ansible-bender build --help` for up to date options:
122141 careful!)
123142 --python-interpreter PYTHON_INTERPRETER
124143 Path to a python interpreter inside the base image
144+
145+ Please use '--' to separate options and arguments.
125146```
0 commit comments