Docker driver options
Docker driver options specification
The following table describes the attributes that can be configured on the Docker driver.
Keywords reference for Docker driver
Keyword | Type | Description | Value |
---|---|---|---|
context | map | It is the Docker build context. There you find the set of files required to build a Docker image. The context cam be located either on a local path, known as path context, or in a git respository, named git context.mandatory | Each context type has its own specifications. Refer to the Docker build contexts section for a detailed description of how to configure each context |
dockerfile | string | Dockerfiles ’s location path. The path is relative to context rootoptional | By default, is used the Dockerfile located at context root |
Docker build contexts
Stevedore supports two kinds of Docker build context. The path context, which uses a local folder to create the Docker build context, and the git context, which creates the Docker build context from a git repository.
Path context
Keyword | Type | Description | Value |
---|---|---|---|
path | string | It specifies where to find the files required to build the image mandatory | - |
Git context
Keyword | Type | Description | Value |
---|---|---|---|
git | map | It is the keyword under which are defined the git repository details mandatory | - |
repository | string | Repository specifies the git repository to find the files to build the image. repository keyword is placed under git .mandatory | - |
reference | string | Repository reference required to build the image. reference keyword is placed under git .optional | By default, is used refs/heads/master reference, that belongs to go-git project. |
Variables-mapping reference
Docker driver passes variables mapping
to Docker API as build arguments and each variable can be consumed as an ARG inside the Dockerfile definition.
Key name | Description | Default argument-name | Default argument-value |
---|---|---|---|
image_from_name_key | This is the argument-name that you can use to set the name of the base image that you want to use as a starting point for your Docker image | image_from_name | The argument-value is set as the parent image’s name within the images-tree |
image_from_registry_host_key | This is the argument-name that you can use to set the Docker registry host where the base image is located | image_from_registry_host | The argument-value is set as the parent image’s registry host within the images-tree |
image_from_registry_namespace_key | This is the argument-name that you can use to set the namespace of the Docker registry where the base image is located | image_from_registry_namespace | The argument-value is set as the parent image’s namespace within the images-tree |
image_from_tag_key | This is the argument-name that you can use to set the tag of the base image that you want to use as a starting point for your Docker image | image_from_tag | The argument-value is set as the parent image’s version within the images-tree |
The example below defines a Dockerfile that can use the arguments passed by the docker driver to build a Docker image.
|
|
Last modified March 26, 2023: change header image (ef70c3b)