Container Configuration

Configure Docker containers for Generic artifacts: image selection, commands, environment variables, and approved registries.

Configure how your Generic artifact's Docker container runs, including the image, entry command, arguments, and environment variables.

Native configuration fields

All container settings live under the native key in bricks.json:

Field
Type
Required
Default
Description

type

string

Yes

:

Must be "generic"

path

string

Yes

:

Path to source files relative to package root. Mounted as /workspace

image

string

No

busybox:stable

Docker image to use. Must come from an approved registry

command

array

No

Image's CMD

Entry command array

args

array

No

:

Arguments appended to command

env_vars

object

No

:

Key-value map of environment variables injected into the container

Configuration examples

{
  "native": {
    "type": "generic",
    "path": "./src",
    "image": "python:3.11-slim",
    "command": ["/bin/bash", "-c"],
    "args": [
      "pip install -r /workspace/requirements.txt && python /workspace/scripts/main.py"
    ],
    "env_vars": {
      "PYTHONUNBUFFERED": "1",
      "PYTHONPATH": "/workspace"
    }
  }
}

Approved container registries

Only images from the registries below are accepted at publish time:

Registry
Description

docker.io

Docker Hub

ghcr.io

GitHub Container Registry

quay.io

Red Hat Quay

registry.gitlab.com

GitLab Container Registry

mcr.microsoft.com

Microsoft Container Registry

gcr.io

Google Container Registry

artifactregistry.googleapis.com

Google Artifact Registry

ecr.aws

AWS ECR

*.us-east-1.amazonaws.com

AWS ECR us-east-1

*.eu-west-1.amazonaws.com

AWS ECR eu-west-1

circle-exclamation

Best practices

Image selection

  • Pin versions: use python:3.11-slim instead of python:latest for reproducible builds

  • Use minimal images: Alpine-based images pull faster and have a smaller attack surface

  • Pin digests for production: python@sha256:... guarantees byte-for-byte reproducibility

  • Choose official images: prefer images from trusted publishers

Command configuration

  • Be explicit: always specify command and args rather than relying on image defaults

  • Use absolute paths: reference /workspace/ for all mounted files

  • Handle errors in scripts: use set -e in Bash scripts so failures propagate

Environment variables

  • Use env_vars for static config: values known at publish time (log levels, feature flags)

  • Use props for dynamic config: values that change per collection or deployment

  • Never put secrets in env_vars: use Bluebricks secrets instead; they're injected separately at runtime

Last updated

Was this helpful?