Using artifact images

View as Markdown

Container images stored in Container Image artifacts can be used as execution environments for BUILD actions or as images for custom services. The pipeline pulls images from container.registry.sh without requiring separate authentication credentials. The pipeline must have at least the Read-only permission level for the artifact.

Artifact images in build actions

In the action YAML, set image_location: ARTIFACT_REGISTRY and specify the artifact and the version, which is the image tag:

yaml
- action: Build on artifact image
  type: BUILD
  image_location: ARTIFACT_REGISTRY
  artifact: my-app-image
  version: 1.1.0
  commands: |-
    cat /etc/os-release | head -2
    uname -m

You do not need the docker_image_name and docker_image_tag fields: the image comes from artifact, and the tag from version. The beginning of the action log shows the image being pulled by its full address, for example container.registry.sh/my-workspace/my-app-image:1.1.0.

Image loading...BUILD action running on an artifact image

The image gets into the registry with a regular docker push, described on the Container registry page.

Artifact images in custom services

A service, for example your own database or a mock API, uses the same three fields. Add it in the services section of the BUILD action as type: CUSTOM:

yaml
- action: Test against service
  type: BUILD
  docker_image_name: library/ubuntu
  docker_image_tag: "24.04"
  commands: |-
    getent hosts my-service
  services:
  - type: CUSTOM
    image_location: ARTIFACT_REGISTRY
    artifact: my-app-image
    version: 1.1.0
    connection:
      host: my-service
    inline_commands: sleep 120

The action connects to the service by the host name from connection.host. In the example, getent hosts my-service returns the IP address of the service container.

The inline_commands field is the command the service container starts with. The service is available as long as this command runs, which is why the example uses sleep 120.

Warning
The inline_commands field accepts a single command. Specifying multiple commands on separate lines or separating them with ; causes the service container to terminate immediately, even if the action log indicates that the service has started. To execute multiple commands, combine them using sh -c: yaml inline_commands: sh -c 'echo ready > /tmp/status && sleep 120'

Other service settings, such as ports and cache, are described in Custom services.

Pipeline permissions

The pipeline needs at least the Read-only level in the artifact's Permissions tab. Without it, the action fails before the image is pulled:

Pipeline is not allowed to use artifact: my-app-image [BE2810035]

If the All pipelines row in the artifact's Permissions tab has the Deny level, add the selected pipeline with the + button and set it to Read-only.

Image loading...Read-only access for a single pipeline

Image tags and version immutability

The version field references an image tag rather than an image digest. Image tags in the registry can be overwritten by subsequent docker push operations. Using a unique tag for each published image prevents unintended replacements, provided that existing tags are not reused.

See also:

Last modified on Dec 3, 2026