Skip to content

Commit 7fe067e

Browse files
authored
feat(images): add alpine-agents base image and image build tasks (#69)
* feat(images): publish alpine-agents base image * fix(images): verify node, npm, and python in alpine-agents * chore(images): move Dockerfiles under images and add mise build tasks * fix(images): expose agent CLIs on default PATH * fix(images): verify mise is functional across base images
1 parent a88e8c5 commit 7fe067e

File tree

7 files changed

+79
-6
lines changed

7 files changed

+79
-6
lines changed

.github/workflows/base-image.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ on:
44
push:
55
branches: [main]
66
paths:
7-
- Dockerfile.base-image
8-
- Dockerfile.base-image-docker
7+
- images/Dockerfile.base-image
8+
- images/Dockerfile.base-image-docker
9+
- images/Dockerfile.base-image-agents
910
- scripts/base-image-tag.sh
1011
- .github/workflows/base-image.yml
1112
workflow_dispatch:
@@ -22,11 +23,14 @@ jobs:
2223
matrix:
2324
include:
2425
- image_name: alpine
25-
dockerfile: Dockerfile.base-image
26+
dockerfile: images/Dockerfile.base-image
2627
repository: ghcr.io/buildkite/cleanroom-base/alpine
2728
- image_name: alpine-docker
28-
dockerfile: Dockerfile.base-image-docker
29+
dockerfile: images/Dockerfile.base-image-docker
2930
repository: ghcr.io/buildkite/cleanroom-base/alpine-docker
31+
- image_name: alpine-agents
32+
dockerfile: images/Dockerfile.base-image-agents
33+
repository: ghcr.io/buildkite/cleanroom-base/alpine-agents
3034
steps:
3135
- uses: actions/checkout@v4
3236

.mise.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,23 @@ run = "scripts/build-go.sh"
2727
description = "Build macOS darwin-vz helper into dist/"
2828
run = "{% if os() == \"macos\" %}mkdir -p dist && xcrun swiftc -O -framework Virtualization cmd/cleanroom-darwin-vz/main.swift -o dist/cleanroom-darwin-vz && codesign --force --sign - --entitlements cmd/cleanroom-darwin-vz/entitlements.plist dist/cleanroom-darwin-vz{% else %}true{% endif %}"
2929

30+
[tasks."build:image:alpine"]
31+
description = "Build local alpine base image"
32+
run = "docker build -f images/Dockerfile.base-image -t cleanroom-base:alpine ."
33+
34+
[tasks."build:image:alpine-docker"]
35+
description = "Build local alpine-docker base image"
36+
run = "docker build -f images/Dockerfile.base-image-docker -t cleanroom-base:alpine-docker ."
37+
38+
[tasks."build:image:alpine-agents"]
39+
description = "Build local alpine-agents base image"
40+
run = "docker build -f images/Dockerfile.base-image-agents -t cleanroom-base:alpine-agents ."
41+
42+
[tasks."build:images"]
43+
description = "Build all local base images"
44+
depends = ["build:image:alpine", "build:image:alpine-docker", "build:image:alpine-agents"]
45+
run = "true"
46+
3047
[tasks.build]
3148
description = "Build binaries into dist/"
3249
depends = ["build:go", "build:darwin"]

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,17 @@ cleanroom image import ghcr.io/buildkite/cleanroom-base/alpine@sha256:... ./root
220220
cleanroom image bump-ref # resolve :latest tag to digest and update cleanroom.yaml
221221
```
222222

223-
`ghcr.io/buildkite/cleanroom-base/alpine` and `ghcr.io/buildkite/cleanroom-base/alpine-docker` are published from this repo on pushes to `main`.
223+
`ghcr.io/buildkite/cleanroom-base/alpine`, `ghcr.io/buildkite/cleanroom-base/alpine-docker`, and `ghcr.io/buildkite/cleanroom-base/alpine-agents` are published from this repo on pushes to `main`.
224+
225+
Build these locally with `mise`:
226+
227+
```bash
228+
mise run build:images
229+
# or individually:
230+
mise run build:image:alpine
231+
mise run build:image:alpine-docker
232+
mise run build:image:alpine-agents
233+
```
224234

225235
## Runtime config
226236

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ RUN apk add --no-cache \
55
strace \
66
mise
77

8+
RUN mise --version
9+
810
CMD ["/bin/sh"]
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
FROM alpine:3.22
2+
3+
ARG CODEX_VERSION=0.106.0
4+
ARG CLAUDE_CODE_VERSION=2.1.63
5+
ARG GEMINI_CLI_VERSION=0.31.0
6+
7+
# `gemini` currently needs native build deps on Alpine and GNU `env` for `env -S`.
8+
RUN apk add --no-cache \
9+
coreutils \
10+
g++ \
11+
git \
12+
make \
13+
nodejs \
14+
npm \
15+
python3 \
16+
strace \
17+
mise
18+
19+
# Install common agent CLIs with pinned versions for reproducible builds.
20+
RUN mise use -g --pin \
21+
npm:@openai/codex@"${CODEX_VERSION}" \
22+
npm:@anthropic-ai/claude-code@"${CLAUDE_CODE_VERSION}" \
23+
npm:@google/gemini-cli@"${GEMINI_CLI_VERSION}"
24+
25+
# Ensure agent binaries are available on the default PATH even when OCI env
26+
# metadata is not propagated.
27+
RUN ln -sf /root/.local/share/mise/shims/codex /usr/local/bin/codex \
28+
&& ln -sf /root/.local/share/mise/shims/claude /usr/local/bin/claude \
29+
&& ln -sf /root/.local/share/mise/shims/gemini /usr/local/bin/gemini
30+
31+
ENV PATH="/root/.local/share/mise/shims:${PATH}"
32+
33+
RUN mise --version && node --version && npm --version && python3 --version \
34+
&& PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" codex --version \
35+
&& PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" claude --version \
36+
&& PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" gemini --version
37+
38+
CMD ["/bin/sh"]
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@ RUN apk add --no-cache \
66
strace \
77
mise
88

9+
RUN docker --version && mise --version
10+
911
CMD ["/bin/sh"]

scripts/base-image-tag.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
set -euo pipefail
33

44
image_name="${1:-alpine}"
5-
dockerfile="${2:-Dockerfile.base-image}"
5+
dockerfile="${2:-images/Dockerfile.base-image}"
66

77
if [[ ! -f "$dockerfile" ]]; then
88
echo "dockerfile not found: $dockerfile" >&2

0 commit comments

Comments
 (0)