2
2
3
3
## Target image metadata
4
4
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:
7
7
8
8
* Setting specific Ansible variables inside your playbook.
9
9
* CLI options of ` ansible-bender build ` .
10
10
11
11
12
12
### Via playbook vars
13
13
14
- ** This feature is present in git master only, it was not released yet.**
15
-
16
14
Configuration is done using a top-level Ansible variable ` ansible_bender ` . All
17
15
the values are nested under it. The values are processed before a build starts.
18
16
The 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.
51
49
| ----------------------| -----------------| ----------------------------------------------------------------------|
52
50
| ` name ` | string | name of the image |
53
51
| ` 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) |
54
53
| ` environment ` | dict | implicit environment variables to set in a container |
55
54
| ` cmd ` | string | a default command to invoke the container |
56
55
| ` 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.
91
90
Please check out ` ansible-bender build --help ` for up to date options:
92
91
93
92
```
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:
94
111
-h, --help show this help message and exit
95
112
--builder {docker,buildah}
96
113
pick preferred builder backend
@@ -104,9 +121,11 @@ Please check out `ansible-bender build --help` for up to date options:
104
121
'/host/dir:/container/dir'
105
122
-w WORKDIR, --workdir WORKDIR
106
123
path to an implicit working directory in the container
107
- -l [LABELS [LABELS ...]], --labels [LABELS [LABELS ...]]
124
+ -l [LABELS [LABELS ...]], --label [LABELS [LABELS ...]]
108
125
add a label to the metadata of the image, should be
109
126
specified as 'key=value'
127
+ --annotation [ANNOTATIONS [ANNOTATIONS ...]]
128
+ Add key=value annotation for the target image
110
129
-e [ENV_VARS [ENV_VARS ...]], --env-vars [ENV_VARS [ENV_VARS ...]]
111
130
add an environment variable to the metadata of the
112
131
image, should be specified as 'KEY=VALUE'
@@ -122,4 +141,6 @@ Please check out `ansible-bender build --help` for up to date options:
122
141
careful!)
123
142
--python-interpreter PYTHON_INTERPRETER
124
143
Path to a python interpreter inside the base image
144
+
145
+ Please use '--' to separate options and arguments.
125
146
```
0 commit comments