Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .github/workflows/build-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ jobs:
with:
context: .
file: Dockerfile.unified
target: builder
target: local_builder
platforms: ${{ matrix.platform.os }}
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/builder:${{ needs.matrix.outputs.tag }}-${{ matrix.platform.arch }}
Expand Down Expand Up @@ -168,9 +168,6 @@ jobs:
build-args: |
BUILDER_IMAGE=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/builder:${{ needs.matrix.outputs.tag }}-${{ matrix.platform.arch }}
outputs: type=image,name=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true
cache-from: |
type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/builder:${{ needs.matrix.outputs.tag }}-${{ matrix.platform.arch }}
type=gha,scope=builder-${{ matrix.platform.arch }}

- name: Export digest
run: |
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/build-operator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:
with:
context: .
file: Dockerfile.unified
target: builder
target: local_builder
platforms: ${{ matrix.platform.os }}
# Always push builder — it's an internal image needed by build-agents.
# dry_run only gates the final agent image push + manifest creation.
Expand Down Expand Up @@ -154,10 +154,7 @@ jobs:
BUILDER_IMAGE=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/builder:${{ needs.resolve-tag.outputs.chart_version }}-${{ matrix.platform.arch }}
outputs: type=image,name=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=${{ inputs.dry_run != true }}
no-cache: ${{ inputs.no_cache == true }}
cache-from: |
type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/builder:${{ needs.resolve-tag.outputs.chart_version }}-${{ matrix.platform.arch }}
${{ inputs.no_cache != true && format('type=gha,scope=unified-builder-{0}', matrix.platform.arch) || '' }}
${{ inputs.no_cache != true && format('type=gha,scope=unified-agent-{0}-{1}', matrix.agent, matrix.platform.arch) || '' }}
cache-from: ${{ inputs.no_cache != true && format('type=gha,scope=unified-agent-{0}-{1}', matrix.agent, matrix.platform.arch) || '' }}
cache-to: ${{ inputs.no_cache != true && format('type=gha,scope=unified-agent-{0}-{1},mode=max', matrix.agent, matrix.platform.arch) || '' }}

- name: Export digest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-smoke-test-unified.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
with:
context: .
file: Dockerfile.unified
target: builder
target: local_builder
load: true
tags: openab-builder:local
cache-to: type=gha,scope=unified-smoke-builder,mode=max
Expand Down
27 changes: 22 additions & 5 deletions Dockerfile.unified
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
# Dockerfile.unified — Single multi-target Dockerfile for all OpenAB agent variants.
# Usage: docker build --target <agent> -t ghcr.io/openabdev/openab:<tag>-<agent> .
#
# The shared builder compiles the openab binary once (unified mode, superset).
# Each agent target is a thin runtime layer that installs only the agent CLI.
# Architecture:
# local_builder — compiles the openab binary (only runs locally or in build-core CI job)
# builder — alias that resolves to local_builder (default) or a prebuilt registry
# image (when BUILDER_IMAGE is overridden in CI). BuildKit prunes
# local_builder when it's not needed.
# <agent> — thin runtime layer that installs only the agent CLI + copies binary
# from builder stage.

# Global ARG — must be declared before first FROM for use in FROM instructions
ARG BUILDER_IMAGE=local_builder

# =============================================================================
# Stage: builder — compile openab binary (unified mode)
# Stage: local_builder — compile openab binary (unified mode)
# Only executed during build-core or local dev. When BUILDER_IMAGE is overridden
# (CI build-agents), BuildKit prunes this stage entirely via dependency analysis.
# =============================================================================
ARG BUILDER_IMAGE=rust:1-bookworm
FROM ${BUILDER_IMAGE} AS builder
FROM rust:1-bookworm AS local_builder
WORKDIR /build
COPY Cargo.toml Cargo.lock ./
COPY crates/openab-core/Cargo.toml crates/openab-core/Cargo.toml
Expand All @@ -30,6 +39,14 @@
COPY agy-acp/ agy-acp/
RUN cd agy-acp && printf '\n[workspace]\n' >> Cargo.toml && cargo build --release

# =============================================================================
# Stage: builder — resolves to either local_builder or prebuilt registry image
# =============================================================================
FROM ${BUILDER_IMAGE} AS builder
RUN test -x /build/target/release/openab \
&& test -x /build/openab-agent/target/release/openab-agent \
&& test -x /build/agy-acp/target/release/agy-acp

# =============================================================================
# Stage: base-debian — shared runtime base for debian-based agents
# =============================================================================
Expand Down Expand Up @@ -81,7 +98,7 @@
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD pgrep -x openab || exit 1
ENV OPENAB_AGENT_COMMAND="kiro-cli acp --trust-all-tools"
ENV OPENAB_AGENT_AUTH_COMMAND="kiro-cli login --use-device-flow"

Check warning on line 101 in Dockerfile.unified

View workflow job for this annotation

GitHub Actions / smoke-test-unified (kiro, kiro-cli)

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "OPENAB_AGENT_AUTH_COMMAND") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
ENTRYPOINT ["tini", "--"]
CMD ["openab", "run", "-c", "/etc/openab/config.toml"]

Expand All @@ -101,7 +118,7 @@
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD pgrep -x openab || exit 1
ENV OPENAB_AGENT_COMMAND="claude"
ENV OPENAB_AGENT_AUTH_COMMAND="claude auth login"

Check warning on line 121 in Dockerfile.unified

View workflow job for this annotation

GitHub Actions / smoke-test-unified (claude, claude)

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "OPENAB_AGENT_AUTH_COMMAND") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
ENTRYPOINT ["tini", "--"]
CMD ["openab", "run", "-c", "/etc/openab/config.toml"]

Expand All @@ -120,7 +137,7 @@
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD pgrep -x openab || exit 1
ENV OPENAB_AGENT_COMMAND="codex-acp"
ENV OPENAB_AGENT_AUTH_COMMAND="codex login --device-auth"

Check warning on line 140 in Dockerfile.unified

View workflow job for this annotation

GitHub Actions / smoke-test-unified (codex, codex-acp)

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "OPENAB_AGENT_AUTH_COMMAND") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
ENTRYPOINT ["tini", "--"]
CMD ["openab", "run", "-c", "/etc/openab/config.toml"]

Expand All @@ -138,7 +155,7 @@
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD pgrep -x openab || exit 1
ENV OPENAB_AGENT_COMMAND="copilot --acp --stdio"
ENV OPENAB_AGENT_AUTH_COMMAND="copilot login"

Check warning on line 158 in Dockerfile.unified

View workflow job for this annotation

GitHub Actions / smoke-test-unified (copilot, copilot)

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "OPENAB_AGENT_AUTH_COMMAND") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
ENTRYPOINT ["tini", "--"]
CMD ["openab", "run", "-c", "/etc/openab/config.toml"]

Expand All @@ -163,7 +180,7 @@
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD pgrep -x openab || exit 1
ENV OPENAB_AGENT_COMMAND="cursor-agent acp"
ENV OPENAB_AGENT_AUTH_COMMAND="cursor-agent login"

Check warning on line 183 in Dockerfile.unified

View workflow job for this annotation

GitHub Actions / smoke-test-unified (cursor, cursor-agent)

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "OPENAB_AGENT_AUTH_COMMAND") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
ENTRYPOINT ["tini", "--"]
CMD ["openab", "run", "-c", "/etc/openab/config.toml"]

Expand All @@ -181,7 +198,7 @@
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD pgrep -x openab || exit 1
ENV OPENAB_AGENT_COMMAND="gemini --acp"
ENV OPENAB_AGENT_AUTH_COMMAND="gemini auth"

Check warning on line 201 in Dockerfile.unified

View workflow job for this annotation

GitHub Actions / smoke-test-unified (gemini, gemini)

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "OPENAB_AGENT_AUTH_COMMAND") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
ENTRYPOINT ["tini", "--"]
CMD ["openab", "run", "-c", "/etc/openab/config.toml"]

Expand Down Expand Up @@ -212,7 +229,7 @@
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD pgrep -x openab || exit 1
ENV OPENAB_AGENT_COMMAND="grok agent stdio"
ENV OPENAB_AGENT_AUTH_COMMAND="grok login --device-auth"

Check warning on line 232 in Dockerfile.unified

View workflow job for this annotation

GitHub Actions / smoke-test-unified (grok, grok)

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "OPENAB_AGENT_AUTH_COMMAND") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
ENTRYPOINT ["tini", "--"]
CMD ["openab", "run", "-c", "/etc/openab/config.toml"]

Expand Down Expand Up @@ -247,7 +264,7 @@
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD pgrep -x openab || exit 1
ENV OPENAB_AGENT_COMMAND="hermes-acp"
ENV OPENAB_AGENT_AUTH_COMMAND="hermes auth add"

Check warning on line 267 in Dockerfile.unified

View workflow job for this annotation

GitHub Actions / smoke-test-unified (hermes, hermes-acp)

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "OPENAB_AGENT_AUTH_COMMAND") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
ENTRYPOINT ["tini", "--"]
CMD ["openab", "run", "-c", "/etc/openab/config.toml"]

Expand All @@ -265,7 +282,7 @@
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD pgrep -x openab || exit 1
ENV OPENAB_AGENT_COMMAND="mimo acp"
ENV OPENAB_AGENT_AUTH_COMMAND="mimo auth login --provider mimo --method \"MiMo Auto (free)\""

Check warning on line 285 in Dockerfile.unified

View workflow job for this annotation

GitHub Actions / smoke-test-unified (mimocode, mimo)

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "OPENAB_AGENT_AUTH_COMMAND") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
ENTRYPOINT ["tini", "--"]
CMD ["openab", "run", "-c", "/etc/openab/config.toml"]

Expand All @@ -283,7 +300,7 @@
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD pgrep -x openab || exit 1
ENV OPENAB_AGENT_COMMAND="opencode acp"
ENV OPENAB_AGENT_AUTH_COMMAND="opencode auth login"

Check warning on line 303 in Dockerfile.unified

View workflow job for this annotation

GitHub Actions / smoke-test-unified (opencode, opencode)

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "OPENAB_AGENT_AUTH_COMMAND") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
ENTRYPOINT ["tini", "--"]
CMD ["openab", "run", "-c", "/etc/openab/config.toml"]

Expand Down Expand Up @@ -311,7 +328,7 @@
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD pgrep -x openab || exit 1
ENV OPENAB_AGENT_COMMAND="agy-acp"
ENV OPENAB_AGENT_AUTH_COMMAND="agy auth"

Check warning on line 331 in Dockerfile.unified

View workflow job for this annotation

GitHub Actions / smoke-test-unified (antigravity, agy-acp)

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "OPENAB_AGENT_AUTH_COMMAND") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
ENTRYPOINT ["tini", "--"]
CMD ["openab", "run", "-c", "/etc/openab/config.toml"]

Expand All @@ -330,7 +347,7 @@
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD pgrep -x openab || exit 1
ENV OPENAB_AGENT_COMMAND="openab-agent"
ENV OPENAB_AGENT_AUTH_COMMAND="pi /login"

Check warning on line 350 in Dockerfile.unified

View workflow job for this annotation

GitHub Actions / smoke-test-unified (pi, pi-acp)

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "OPENAB_AGENT_AUTH_COMMAND") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
ENTRYPOINT ["tini", "--"]
CMD ["openab", "run", "-c", "/etc/openab/config.toml"]

Expand All @@ -347,7 +364,7 @@
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD pgrep -x openab || exit 1
ENV OPENAB_AGENT_COMMAND="openab-agent"
ENV OPENAB_AGENT_AUTH_COMMAND="openab-agent auth codex-oauth --no-browser"

Check warning on line 367 in Dockerfile.unified

View workflow job for this annotation

GitHub Actions / smoke-test-unified (native, openab-agent)

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "OPENAB_AGENT_AUTH_COMMAND") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
ENTRYPOINT ["tini", "--"]
CMD ["openab", "run", "-c", "/etc/openab/config.toml"]

Expand Down
Loading