Image

Define the Docker images you want to build

Stevedore represents a Docker image by an image definition, therefore an image holds the details required to build a Docker image. Note that an image by itself has no sense, it must be defined within the images-tree.

Keywords reference

That section conveys the description of the attributes that you can use to define an image.

KeywordTypeDescriptionValue
builderstring/mapIdentifies the builder to use to create the image.
You can define it as a string when you want to refer to a global-builder.
To designate it such an in-line builder, you have to define it as a yaml data-structure. In the builder’s reference guide you have the details to define it.
If the builder attribute is not defined, it is used a builder which does not perform actions.
optional
-
childrenmapContains references to descendant images which uses the current image as parent.
optional
It is a map where each key refers to an image name within the images-tree and the value is a list of image versions.

Example:
children:
child1:
- v1
- v2
namestringIt is the image name.
optional
By default its value is defined as the images-tree’s image name key
namespacestringIt is the Docker`s registry namespace.
optional
-
parentsmapContains the references to the parent images from which the current image can be built.
optional
It is a map that provides a reference to the parent images within the images-tree. Each key identifies the parent name and the value is a list of versions.

Example:
parents:
parent1:
- v1
- v2
persistent_varslist(map)You define there a list of variables required to build the Docker image. That variables are inherit by the children images.
optional
Its value is a key-value data-structure where each key is an string and its value a yaml data-structure.

Example:
persistent_vars:
var1: value
var2: value
registrystringIt is the Docker’s registry host.
optional
-
tagslist(string)You define a list of additional tags to generate.
optional
-
varslist(map)You define there a list of variables required to build the Docker image.
optional
Its value is a key-value structure where each key is an string and its value a yaml data-structure.

Example:
vars:
var1: value
var2: value
versionstringIt is the Docker’s image tag.
optional
By default its value is defined as the images-tree’s image version key
persistent_labelslist(map)It is a key-value metadata pair that provides descriptive information about the image. That variables are inherit by the children images.
optional
Its value is a key-value structure where each key is an string and its value a yaml data-structure.

Example:
persistent_labels:
label1: value
label2: value
labelslist(map)It is a key-value metadata pair that provides descriptive information about the image.
optional
Its value is a key-value structure where each key is an string and its value a yaml data-structure.

Example:
labels:
label1: value
label2: value

Templating image attributes

An image definition allows you to define the values of its attributes as a Golang text template. To achieve that, Stevedore provides you with the following template variables.

NameVariableDescription
nameNameIt provides the image’s name within the images-tree
versionVersionIt provides the image’s version within the images-tree
parentParentIt let you to achieve the templating image attributes from the parent image. You can access, example to {{ .Parent.Name }} attribute.
date RFC3339DateRFC3339It stores a date and time value in a string format that conforms to the RFC 3339 standard. The format includes the year, month, day, hour, minute, and second components, and optionally the fraction of a second and the time zone offset.
date RFC3339 NanoDateRFC3339NanoIt refers to a date/time value formatted according to the RFC3339Nano specification, which includes nanosecond precision. This specification defines a standard format for representing dates and times in machine-readable formats, using the ISO 8601 standard.

Image definition example

The following example is provided for illustrative purposes only and should not be copied and pasted into your configuration.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
name: base-apps
version: 3.2.1
builder:
  driver: docker
  options:
  	context:
	  path: ./base-app
namespace: stable
registry: registry.stevedore.test
tags:
  - latest
persistent_labels:
  created_at: "{{ .DateRFC3339Nano }}"
  created_by: stevedore
labels:
  parent_image: "{{ .Parent.Name }}:{{ .Parent.Version }}"
persistent_vars:
  base_version: "{{ .Version }}"
vars:
  os_base: rootfs.tar
parents:
  alpine:
    - "1.36"
  ubuntu:
    - "22.04"
Last modified April 24, 2023: create docs-v0.11 (331b058)