Build a custom runner image

Extend the official runner or bring your own image with the execution CLI.

The controller image is not the runner. Argo starts a Pod for each execution step using the image declared in the template. The runner implements your IaC automation and uses the versioned iacstack CLI to communicate through the execution contract. The two official runners contain Bash, Git, jq, CA certificates, the CLI and their respective IaC engine. They run as UID/GID 10001 and use /tmp as HOME. They do not include AWS CLI or kubectl.

Option A — Extend the official runner

Create a Dockerfile in a new build directory (outside the downloaded quickstart files). For example, add curl to the OpenTofu runner. To extend Terraform, use the corresponding Terraform image instead.

FROM ghcr.io/iacstack/iacstack-runner-opentofu:v0.1.0-alpha.2
USER root
RUN apt-get update \
    && apt-get install -y --no-install-recommends curl \
    && rm -rf /var/lib/apt/lists/*
USER 10001:10001

Install your additional tools, scripts and certificates at build time, pin dependencies where possible, then restore a non-root user. Do not bake credentials into the image.

Option B — Start with your own base image

The Dockerfile below does not use any project image, even as a build stage. It compiles the CLI from a tagged checkout and copies OpenTofu from its upstream distribution into a Debian base. Use a new build directory. If you already have a toolchain, keep it and add only the CLI.

# syntax=docker/dockerfile:1
FROM --platform=$BUILDPLATFORM golang:1.26.11-bookworm AS cli-build
ARG TARGETOS
ARG TARGETARCH
ARG IACSTACK_VERSION=v0.1.0-alpha.2
WORKDIR /src
RUN git clone --depth 1 --branch "$IACSTACK_VERSION" https://github.com/iacstack/iac-stack-controller.git .
RUN CGO_ENABLED=0 GOOS="$TARGETOS" GOARCH="$TARGETARCH" \
    go build -mod=readonly -trimpath -o /iacstack ./cmd/iacstack

FROM ghcr.io/opentofu/opentofu:1.13.11-minimal AS engine
FROM debian:trixie-slim
RUN apt-get update \
    && apt-get install -y --no-install-recommends bash ca-certificates git jq \
    && rm -rf /var/lib/apt/lists/* \
    && groupadd --gid 10001 iacstack \
    && useradd --uid 10001 --gid 10001 --home-dir /tmp --no-create-home --no-log-init iacstack
COPY --from=cli-build /iacstack /usr/local/bin/iacstack
COPY --from=cli-build /src/LICENSE /src/NOTICE /src/THIRD_PARTY_NOTICES.md /usr/share/licenses/iacstack/
COPY --from=engine /usr/local/bin/tofu /usr/local/bin/tofu
ENV HOME=/tmp TF_IN_AUTOMATION=true TF_INPUT=false
USER 10001:10001
ENTRYPOINT ["bash"]

The simplest way to connect a pipeline to the controller is the iacstack CLI. It reads intent and writes contract signals; your workflow exposes those files as Argo global output parameters. For a quicker build, copy the prebuilt /usr/local/bin/iacstack from an official runner at the same version in a separate Docker stage. The release does not publish a separate executable download on GitHub. Either way, provide a writable output directory (default /tmp) and the identity required for Kubernetes API calls if authorization is enabled.

Build, verify and publish

For either option, authenticate to a registry you control and run:

IMAGE=ghcr.io/YOUR_ORG/my-iac-runner:v1.0.0
# Replace YOUR_ORG with a writable registry namespace and authenticate first.
docker buildx build --platform linux/amd64 --load -t "$IMAGE" .
docker run --rm --entrypoint /usr/local/bin/iacstack "$IMAGE" --help
docker run --rm --entrypoint bash "$IMAGE" -ec 'id; git --version; jq --version; tofu version'
docker push "$IMAGE"

Use immutable tags or digests for shared deployments. Scan your own image; the project’s release security checks cover only the official artifacts. Ensure the Kubernetes nodes can pull the image, including imagePullSecrets on the WorkflowTemplate or its ServiceAccount where required.

Use the image in a workflow

Complete Create your own workflow first. With the OpenTofu custom image, return to the quickstart directory and keep IMAGE and APP_VERSION set. Drain active attempts on the alias before updating its template.

sed "s|ghcr.io/iacstack/iacstack-runner-opentofu:$APP_VERSION|$IMAGE|" \
  my-workflow.yaml > my-workflow-custom-image.yaml
kubectl apply -f my-workflow-custom-image.yaml
kubectl -n platform-system patch iacstack custom-stack --type merge \
  -p '{"spec":{"inputs":{"message":"Hello from my runner"}}}'

Check the new Workflow and Pod image and verify the ConfigMap message. For a Terraform custom runner, set both script.image and the IAC_ENGINE environment value accordingly. A multi-step pipeline may use different images for policy, plan and apply; only steps publishing protocol signals or reading intent need the CLI.

Read the CLI reference for the contract and Bring your own workflow for migrating an existing pipeline.