Skip to content

Commit be191ce

Browse files
barckcodeclaude
andcommitted
feat: add multi-arch Docker image builds (amd64 + arm64)
Build all images for linux/amd64 and linux/arm64 using Docker Buildx and QEMU. Compile sidecar binary for both architectures and select the correct one via TARGETARCH in agent Dockerfiles. Bump version to 0.2.1. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b8aab34 commit be191ce

6 files changed

Lines changed: 31 additions & 14 deletions

File tree

.github/workflows/release.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,13 @@ jobs:
3636
run: go test -race ./...
3737

3838
- name: Build sidecar binary for Linux amd64
39-
run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -trimpath -o bin/sidecar-linux ./cmd/sidecar
39+
run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -trimpath -o bin/sidecar-linux-amd64 ./cmd/sidecar
40+
41+
- name: Build sidecar binary for Linux arm64
42+
run: CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -trimpath -o bin/sidecar-linux-arm64 ./cmd/sidecar
43+
44+
- name: Set up QEMU for multi-arch builds
45+
uses: docker/setup-qemu-action@v3
4046

4147
- name: Set up Docker Buildx
4248
uses: docker/setup-buildx-action@v3
@@ -53,6 +59,7 @@ jobs:
5359
with:
5460
context: .
5561
file: build/api/Dockerfile
62+
platforms: linux/amd64,linux/arm64
5663
push: true
5764
provenance: false
5865
tags: |
@@ -65,14 +72,17 @@ jobs:
6572

6673
- name: Prepare agent build contexts
6774
run: |
68-
cp bin/sidecar-linux build/agent/sidecar
69-
cp bin/sidecar-linux build/opencode-agent/sidecar
75+
cp bin/sidecar-linux-amd64 build/agent/sidecar-amd64
76+
cp bin/sidecar-linux-arm64 build/agent/sidecar-arm64
77+
cp bin/sidecar-linux-amd64 build/opencode-agent/sidecar-amd64
78+
cp bin/sidecar-linux-arm64 build/opencode-agent/sidecar-arm64
7079
7180
- name: Build and push Agent image
7281
uses: docker/build-push-action@v6
7382
with:
7483
context: build/agent
7584
file: build/agent/Dockerfile
85+
platforms: linux/amd64,linux/arm64
7686
push: true
7787
provenance: false
7888
tags: |
@@ -88,6 +98,7 @@ jobs:
8898
with:
8999
context: build/opencode-agent
90100
file: build/opencode-agent/Dockerfile
101+
platforms: linux/amd64,linux/arm64
91102
push: true
92103
provenance: false
93104
tags: |

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,7 @@ Thumbs.db
4040

4141
# Build artifacts
4242
dist/
43+
44+
# Sidecar binaries copied into build contexts
45+
build/agent/sidecar-*
46+
build/opencode-agent/sidecar-*

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ build-sidecar:
1717
go build -o $(BIN_DIR)/sidecar ./cmd/sidecar
1818

1919
build-sidecar-linux:
20-
GOOS=linux GOARCH=$(DOCKER_ARCH) go build -o $(BIN_DIR)/sidecar-linux ./cmd/sidecar
20+
GOOS=linux GOARCH=$(DOCKER_ARCH) go build -o $(BIN_DIR)/sidecar-linux-$(DOCKER_ARCH) ./cmd/sidecar
2121

2222
build-all: build-api build-sidecar
2323

@@ -35,14 +35,14 @@ build-api-image:
3535
docker build -t agentcrew-api:$(IMAGE_TAG) -f build/api/Dockerfile .
3636

3737
build-agent-image: build-sidecar-linux
38-
cp $(BIN_DIR)/sidecar-linux build/agent/sidecar
38+
cp $(BIN_DIR)/sidecar-linux-$(DOCKER_ARCH) build/agent/sidecar-$(DOCKER_ARCH)
3939
docker build -t agentcrew-agent:$(IMAGE_TAG) -f build/agent/Dockerfile build/agent
40-
rm -f build/agent/sidecar $(BIN_DIR)/sidecar-linux
40+
rm -f build/agent/sidecar-$(DOCKER_ARCH) $(BIN_DIR)/sidecar-linux-$(DOCKER_ARCH)
4141

4242
build-opencode-agent-image: build-sidecar-linux
43-
cp $(BIN_DIR)/sidecar-linux build/opencode-agent/sidecar
43+
cp $(BIN_DIR)/sidecar-linux-$(DOCKER_ARCH) build/opencode-agent/sidecar-$(DOCKER_ARCH)
4444
docker build -t agentcrew-opencode-agent:$(IMAGE_TAG) -f build/opencode-agent/Dockerfile build/opencode-agent
45-
rm -f build/opencode-agent/sidecar $(BIN_DIR)/sidecar-linux
45+
rm -f build/opencode-agent/sidecar-$(DOCKER_ARCH) $(BIN_DIR)/sidecar-linux-$(DOCKER_ARCH)
4646

4747
build-images: build-api-image build-agent-image build-opencode-agent-image
4848

@@ -70,4 +70,4 @@ lint:
7070
clean:
7171
rm -rf $(BIN_DIR)
7272
go clean -testcache
73-
rm -f build/agent/sidecar build/opencode-agent/sidecar
73+
rm -f build/agent/sidecar-* build/opencode-agent/sidecar-*

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.2.0
1+
0.2.1

build/agent/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ RUN npm install -g @anthropic-ai/claude-code skills
1515
# Create non-root user for running the agent
1616
RUN groupadd -r agentcrew && useradd -r -g agentcrew -m agentcrew
1717

18-
# Copy the sidecar binary (built externally with Go)
19-
COPY sidecar /usr/local/bin/agent-sidecar
18+
# Copy the sidecar binary for the target architecture (built externally with Go)
19+
ARG TARGETARCH
20+
COPY sidecar-${TARGETARCH} /usr/local/bin/agent-sidecar
2021
RUN chmod +x /usr/local/bin/agent-sidecar
2122

2223
# Create workspace directory for agent operations

build/opencode-agent/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ RUN npm install -g opencode-ai skills
1515
# Create non-root user for running the agent
1616
RUN groupadd -r agentcrew && useradd -r -g agentcrew -m agentcrew
1717

18-
# Copy the sidecar binary (built externally with Go)
19-
COPY sidecar /usr/local/bin/agent-sidecar
18+
# Copy the sidecar binary for the target architecture (built externally with Go)
19+
ARG TARGETARCH
20+
COPY sidecar-${TARGETARCH} /usr/local/bin/agent-sidecar
2021
RUN chmod +x /usr/local/bin/agent-sidecar
2122

2223
# Create workspace directory for agent operations

0 commit comments

Comments
 (0)