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
16 changes: 6 additions & 10 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ jobs:
with:
go-version-file: go.mod

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GHCR
uses: docker/login-action@v3
with:
Expand All @@ -40,21 +43,14 @@ jobs:
echo "version=main" >> "$GITHUB_OUTPUT"
fi

- name: Build images
- name: Build and push multi-arch images
env:
VERSION: ${{ steps.version.outputs.version }}
run: make image VERSION="$VERSION"

- name: Push images
env:
VERSION: ${{ steps.version.outputs.version }}
run: make push VERSION="$VERSION"
run: make push-multiarch VERSION="$VERSION"

- name: Push latest tags for releases
if: startsWith(github.ref, 'refs/tags/v')
run: |
make image VERSION=latest
make push VERSION=latest
run: make push-multiarch VERSION=latest

- name: Build CLI binaries
if: startsWith(github.ref, 'refs/tags/v')
Expand Down
14 changes: 10 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,6 @@ run: ## Run a controller from your host.

.PHONY: image
image: ## Build docker images (use WHAT to build specific image).
@for dir in $(filter cmd/%,$(or $(WHAT),$(IMAGE_DIRS))); do \
GOOS=linux GOARCH=amd64 $(MAKE) build WHAT=$$dir; \
done
@GOOS=linux GOARCH=amd64 $(MAKE) build WHAT=cmd/kelos-capture
@for dir in $(or $(WHAT),$(IMAGE_DIRS)); do \
docker build -t $(REGISTRY)/$$(basename $$dir):$(VERSION) -f $$dir/Dockerfile .; \
done
Expand All @@ -95,6 +91,16 @@ push: ## Push docker images (use WHAT to push specific image).
docker push $(REGISTRY)/$$(basename $$dir):$(VERSION); \
done

DOCKER_PLATFORMS ?= linux/amd64,linux/arm64

.PHONY: push-multiarch
push-multiarch: ## Build and push multi-arch docker images.
@for dir in $(or $(WHAT),$(IMAGE_DIRS)); do \
docker buildx build --platform $(DOCKER_PLATFORMS) \
-t $(REGISTRY)/$$(basename $$dir):$(VERSION) \
-f $$dir/Dockerfile --push .; \
done

RELEASE_PLATFORMS ?= linux/amd64 linux/arm64 darwin/amd64 darwin/arm64

.PHONY: release-binaries
Expand Down
9 changes: 8 additions & 1 deletion claude-code/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
FROM golang:1.25 AS builder
Copy link

@cubic-dev-ai cubic-dev-ai bot Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: New builder stage uses an unpinned golang image tag, making shipped binary builds non-deterministic and vulnerable to upstream image drift.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At claude-code/Dockerfile, line 1:

<comment>New builder stage uses an unpinned `golang` image tag, making shipped binary builds non-deterministic and vulnerable to upstream image drift.</comment>

<file context>
@@ -1,3 +1,10 @@
+FROM golang:1.25 AS builder
+WORKDIR /workspace
+COPY go.mod go.sum ./
</file context>
Fix with Cubic

WORKDIR /workspace
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -o bin/kelos-capture ./cmd/kelos-capture

FROM ubuntu:24.04

ARG GO_VERSION=1.25.0
Expand Down Expand Up @@ -33,7 +40,7 @@ RUN npm install -g @anthropic-ai/claude-code@${CLAUDE_CODE_VERSION}
COPY claude-code/kelos_entrypoint.sh /kelos_entrypoint.sh
RUN chmod +x /kelos_entrypoint.sh

COPY bin/kelos-capture /kelos/kelos-capture
COPY --from=builder /workspace/bin/kelos-capture /kelos/kelos-capture

RUN useradd -u 61100 -m -s /bin/bash claude
RUN mkdir -p /home/claude/.claude && chown -R claude:claude /home/claude
Expand Down
9 changes: 8 additions & 1 deletion cmd/kelos-controller/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
FROM golang:1.25 AS builder
WORKDIR /workspace
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -o bin/kelos-controller ./cmd/kelos-controller

FROM gcr.io/distroless/static:nonroot
WORKDIR /
COPY bin/kelos-controller .
COPY --from=builder /workspace/bin/kelos-controller .
USER 65532:65532
ENTRYPOINT ["/kelos-controller"]
9 changes: 8 additions & 1 deletion cmd/kelos-spawner/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
FROM golang:1.25 AS builder
Copy link

@cubic-dev-ai cubic-dev-ai bot Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: New builder base image uses a floating tag (golang:1.25), which can cause non-reproducible builds and external version drift.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At cmd/kelos-spawner/Dockerfile, line 1:

<comment>New builder base image uses a floating tag (`golang:1.25`), which can cause non-reproducible builds and external version drift.</comment>

<file context>
@@ -1,5 +1,12 @@
+FROM golang:1.25 AS builder
+WORKDIR /workspace
+COPY go.mod go.sum ./
</file context>
Suggested change
FROM golang:1.25 AS builder
FROM golang:1.25.0 AS builder
Fix with Cubic

WORKDIR /workspace
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -o bin/kelos-spawner ./cmd/kelos-spawner

FROM gcr.io/distroless/static:nonroot
WORKDIR /
COPY bin/kelos-spawner .
COPY --from=builder /workspace/bin/kelos-spawner .
USER 65532:65532
ENTRYPOINT ["/kelos-spawner"]
9 changes: 8 additions & 1 deletion codex/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
FROM golang:1.25 AS builder
WORKDIR /workspace
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -o bin/kelos-capture ./cmd/kelos-capture

FROM ubuntu:24.04

ARG GO_VERSION=1.25.0
Expand Down Expand Up @@ -33,7 +40,7 @@ RUN npm install -g @openai/codex@${CODEX_VERSION}
COPY codex/kelos_entrypoint.sh /kelos_entrypoint.sh
RUN chmod +x /kelos_entrypoint.sh

COPY bin/kelos-capture /kelos/kelos-capture
COPY --from=builder /workspace/bin/kelos-capture /kelos/kelos-capture

RUN useradd -u 61100 -m -s /bin/bash agent
RUN mkdir -p /home/agent/.codex && chown -R agent:agent /home/agent
Expand Down
9 changes: 8 additions & 1 deletion cursor/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
FROM golang:1.25 AS builder
Copy link

@cubic-dev-ai cubic-dev-ai bot Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Builder toolchain is decoupled from GO_VERSION and uses a floating Go tag, reducing build reproducibility and risking version drift.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At cursor/Dockerfile, line 1:

<comment>Builder toolchain is decoupled from `GO_VERSION` and uses a floating Go tag, reducing build reproducibility and risking version drift.</comment>

<file context>
@@ -1,3 +1,10 @@
+FROM golang:1.25 AS builder
+WORKDIR /workspace
+COPY go.mod go.sum ./
</file context>
Fix with Cubic

WORKDIR /workspace
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -o bin/kelos-capture ./cmd/kelos-capture

FROM ubuntu:24.04

ARG GO_VERSION=1.25.0
Expand Down Expand Up @@ -30,7 +37,7 @@ ENV PATH="/usr/local/go/bin:${PATH}"
COPY cursor/kelos_entrypoint.sh /kelos_entrypoint.sh
RUN chmod +x /kelos_entrypoint.sh

COPY bin/kelos-capture /kelos/kelos-capture
COPY --from=builder /workspace/bin/kelos-capture /kelos/kelos-capture

RUN useradd -u 61100 -m -s /bin/bash agent
RUN mkdir -p /home/agent/.cursor && chown -R agent:agent /home/agent
Expand Down
9 changes: 8 additions & 1 deletion gemini/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
FROM golang:1.25 AS builder
Copy link

@cubic-dev-ai cubic-dev-ai bot Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Builder stage uses a floating Go image tag, making release artifacts non-reproducible across rebuilds.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At gemini/Dockerfile, line 1:

<comment>Builder stage uses a floating Go image tag, making release artifacts non-reproducible across rebuilds.</comment>

<file context>
@@ -1,3 +1,10 @@
+FROM golang:1.25 AS builder
+WORKDIR /workspace
+COPY go.mod go.sum ./
</file context>
Suggested change
FROM golang:1.25 AS builder
FROM golang:1.25.0 AS builder
Fix with Cubic

WORKDIR /workspace
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -o bin/kelos-capture ./cmd/kelos-capture

FROM ubuntu:24.04

ARG GO_VERSION=1.25.0
Expand Down Expand Up @@ -33,7 +40,7 @@ RUN npm install -g @google/gemini-cli@${GEMINI_CLI_VERSION}
COPY gemini/kelos_entrypoint.sh /kelos_entrypoint.sh
RUN chmod +x /kelos_entrypoint.sh

COPY bin/kelos-capture /kelos/kelos-capture
COPY --from=builder /workspace/bin/kelos-capture /kelos/kelos-capture

RUN useradd -u 61100 -m -s /bin/bash agent
RUN mkdir -p /home/agent/.gemini && chown -R agent:agent /home/agent
Expand Down
9 changes: 8 additions & 1 deletion opencode/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
FROM golang:1.25 AS builder
WORKDIR /workspace
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -o bin/kelos-capture ./cmd/kelos-capture

FROM ubuntu:24.04

ARG GO_VERSION=1.25.0
Expand Down Expand Up @@ -33,7 +40,7 @@ RUN npm install -g opencode-ai@${OPENCODE_VERSION}
COPY opencode/kelos_entrypoint.sh /kelos_entrypoint.sh
RUN chmod +x /kelos_entrypoint.sh

COPY bin/kelos-capture /kelos/kelos-capture
COPY --from=builder /workspace/bin/kelos-capture /kelos/kelos-capture

RUN useradd -u 61100 -m -s /bin/bash agent
RUN mkdir -p /home/agent/.opencode && chown -R agent:agent /home/agent
Expand Down
Loading