Skip to main content

Docker

Build and push multi-arch Docker images

Anodizer builds Docker images via docker buildx, supporting multi-architecture builds with tag templates.

Minimal config

crates:
  - name: myapp
    docker:
      - image_templates:
          - "myorg/myapp:{{ Version }}"
          - "myorg/myapp:latest"
        dockerfile: Dockerfile

Docker config fields

FieldTypeDefaultDescription
image_templateslistDocker image tags (templates supported)
dockerfilestringDockerfilePath to Dockerfile
platformslistnoneTarget platforms (e.g., linux/amd64, linux/arm64)
binarieslistallWhich binaries to copy into the build context
build_flag_templateslistnoneAdditional docker buildx build flags
skip_pushboolfalseBuild but don't push
extra_fileslistnoneExtra files to copy into build context
push_flagslistnoneAdditional push flags

Multi-arch builds

docker:
  - image_templates:
      - "myorg/myapp:{{ Version }}"
    dockerfile: Dockerfile
    platforms:
      - linux/amd64
      - linux/arm64

Build flags

Pass additional flags to docker buildx build:

docker:
  - image_templates:
      - "myorg/myapp:{{ Version }}"
    build_flag_templates:
      - "--build-arg=VERSION={{ Version }}"
      - "--label=org.opencontainers.image.version={{ Version }}"

Full example

crates:
  - name: myapp
    docker:
      - image_templates:
          - "ghcr.io/myorg/myapp:{{ Version }}"
          - "ghcr.io/myorg/myapp:latest"
        dockerfile: Dockerfile
        platforms:
          - linux/amd64
          - linux/arm64
        extra_files:
          - config.example.yaml
        build_flag_templates:
          - "--build-arg=VERSION={{ Version }}"