Skip to content

Variables

The pipelines defined in this project consume some or all of the variables defined on this page.

CONTAINER_BUILD_OPTS

Extra options to pass to the container build command.

See Pass container build options for more details.

CONTAINER_COMMIT_SHA

Commit SHA for the container pipeline. Defaults to ${CI_COMMIT_SHA}.

variables:
  CONTAINER_COMMIT_SHA: "

CONTAINER_COMMIT_SHORT_SHA

Commit short SHA for the container pipeline. Defaults to ${CI_COMMIT_SHORT_SHA}.

CONTAINER_CONTEXT

Container build context. Defaults to ${CI_PROJECT_DIR}. Example:

variables:
  CONTAINER_CONTEXT: "${CI_PROJECT_DIR}/some/project/subpath"

CONTAINER_DOCKER_ARCH

docker-multiarch only

This is the name of the machine architecture as defined by Docker.

Common architectures:

  • amd64 - x86 64-bit

  • i386 - x86 64-bit

  • arm64v8 - ARMv8 64-bit

  • arm32v6 - ARMv6 32-bit

  • arm32v7 - ARMv7 32-bit

For all possible architecture values, see this page.

CONTAINER_DOCKER_PLATFORM

docker-multiarch only

This is the value that the docker CLI expects when using the --platform flag.

Common platforms:

  • linux/amd64 - Linux, x86 64-bit

  • linux/386 - Linux, x86 32-bit

  • linux/arm64 - Linux, ARMv8 64-bit

  • linux/arm/v6 - Linux, ARMv6 32-bit

  • linux/arm/v7 - Linux, ARMv7 32-bit

This list can be generated by running docker buildx ls.

CONTAINER_DOCKERFILE

Container build Dockerfile. Defaults to ${CI_PROJECT_DIR}/Dockerfile. Example:

variables:
  CONTAINER_DOCKERFILE: "${CI_PROJECT_DIR}/deploy/docker/Dockerfile"

A fully qualified path to the Dockerfile is required.

CONTAINER_IMAGE

Full name of container image tag. Defaults to ${CONTAINER_NAME}:${CONTAINER_VERSION}. Example:

variables:
  CONTAINER_IMAGE: "${CONTAINER_NAME}:${CONTAINER_VERSION}"

CONTAINER_MULTIARCH_PLATFORMS

docker-multiarch only

Configures the docker-multiarch pipeline to build for multiple architectures.

Defaults to amd64 arm32v6 arm32v7 arm64v8 i386, which enables all currently supported architectures.

variables:
  # only build for arm
  CONTAINER_MULTIARCH_PLATFORMS: arm32v6 arm32v7 arm64v8

For a list of supported values, see CONTAINER_DOCKER_ARCH.

CONTAINER_NAME

Defaults to ${CONTAINER_REGISTRY}${CONTAINER_NAME_SUFFIX}.

variables:
  CONTAINER_NAME: "docker.io/jdoe/mycontainer"

CONTAINER_NAME_SUFFIX

Defaults to an empty string.

variables:
  CONTAINER_NAME_SUFFIX: "/variant"

CONTAINER_PROXY

Defaults to ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/.

variables:
  # proxy images through harbor.example.com
  CONTAINER_PROXY: "harbor.example.com/docker/library/"

Only GitLab Dependency Proxy is currently supported.

For more info, see Configure a Docker Hub proxy.

CONTAINER_REGISTRY

Container registry to publish images to. Defaults to ${CI_REGISTRY_IMAGE}. Example:

variables:
  # push to another project's registry
  CONTAINER_REGISTRY: "registry.gitlab.com/brettops/example/project"

CONTAINER_REGISTRY_USER

Defaults to ${CI_REGISTRY_USER}.

CONTAINER_REGISTRY_PASSWORD

Defaults to ${CI_REGISTRY_PASSWORD}.

CONTAINER_VERSION

Defaults to ${CI_COMMIT_REF_NAME}${CONTAINER_VERSION_SUFFIX}.

variables:
  # pull the version from another variable
  CONTAINER_VERSION: "${ANOTHER_VERSION_VARIABLE}"

CONTAINER_VERSION_SUFFIX

Defaults to an empty string.

variables:
  # append '-ubuntu' to the image tag
  CONTAINER_VERSION_SUFFIX: "-ubuntu"