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
8 changes: 6 additions & 2 deletions .github/workflows/docker-image-agent-runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:

steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Login to Docker Hub
Expand All @@ -25,5 +27,7 @@ jobs:
run: |
docker buildx create --use --platform=linux/amd64,linux/arm64,linux/ppc64le --name multi-platform-builder
docker buildx ls
RUNTIME_IMG=openkruise/agent-runtime:${{ github.ref_name }} make docker-build-runtime
docker push openkruise/agent-runtime:${{ github.ref_name }}
RUNTIME_IMG=openkruise/agent-runtime:${{ github.ref_name }} make docker-buildx-runtime
- name: Push the Docker image
run: |
RUNTIME_IMG=openkruise/agent-runtime:${{ github.ref_name }} make docker-pushx-runtime
8 changes: 6 additions & 2 deletions .github/workflows/docker-image-agent-sandbox-controller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:

steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Login to Docker Hub
Expand All @@ -25,5 +27,7 @@ jobs:
run: |
docker buildx create --use --platform=linux/amd64,linux/arm64,linux/ppc64le --name multi-platform-builder
docker buildx ls
CONTROLLER_IMG=openkruise/agent-sandbox-controller:${{ github.ref_name }} make docker-build-controller
docker push openkruise/agent-sandbox-controller:${{ github.ref_name }}
CONTROLLER_IMG=openkruise/agent-sandbox-controller:${{ github.ref_name }} make docker-buildx-controller
- name: Push the Docker image
run: |
CONTROLLER_IMG=openkruise/agent-sandbox-controller:${{ github.ref_name }} make docker-pushx-controller
8 changes: 6 additions & 2 deletions .github/workflows/docker-image-sandbox-gateway.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:

steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Login to Docker Hub
Expand All @@ -25,5 +27,7 @@ jobs:
run: |
docker buildx create --use --platform=linux/amd64,linux/arm64,linux/ppc64le --name multi-platform-builder
docker buildx ls
GATEWAY_IMG=openkruise/sandbox-gateway:${{ github.ref_name }} make docker-build-sandbox-gateway
docker push openkruise/sandbox-gateway:${{ github.ref_name }}
GATEWAY_IMG=openkruise/sandbox-gateway:${{ github.ref_name }} make docker-buildx-sandbox-gateway
- name: Push the Docker image
run: |
GATEWAY_IMG=openkruise/sandbox-gateway:${{ github.ref_name }} make docker-pushx-sandbox-gateway
8 changes: 6 additions & 2 deletions .github/workflows/docker-image-sandbox-manager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:

steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Login to Docker Hub
Expand All @@ -25,5 +27,7 @@ jobs:
run: |
docker buildx create --use --platform=linux/amd64,linux/arm64,linux/ppc64le --name multi-platform-builder
docker buildx ls
MANAGER_IMG=openkruise/sandbox-manager:${{ github.ref_name }} make docker-build-manager
docker push openkruise/sandbox-manager:${{ github.ref_name }}
MANAGER_IMG=openkruise/sandbox-manager:${{ github.ref_name }} make docker-buildx-manager
- name: Push the Docker image
run: |
MANAGER_IMG=openkruise/sandbox-manager:${{ github.ref_name }} make docker-pushx-manager
43 changes: 42 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ MANAGER_IMG ?= sandbox-manager:latest
RUNTIME_IMG ?= agent-runtime:latest
GATEWAY_IMG ?= $(GATEWAY_PLUGIN_NAME):latest
TRAFFIX_EXTENSION_IMG ?= traffic-extension:latest
PLATFORMS ?= linux/amd64,linux/arm64

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand Down Expand Up @@ -127,14 +128,38 @@ lint-config: golangci-lint ## Verify golangci-lint linter configuration
docker-build-controller: ## Build docker image for agent-sandbox-controller.
docker build -f dockerfiles/agent-sandbox-controller.Dockerfile -t ${CONTROLLER_IMG} .

.PHONY: docker-buildx-controller
docker-buildx-controller: ## Build multi-platform docker image for agent-sandbox-controller.
docker buildx build --platform=$(PLATFORMS) -f dockerfiles/agent-sandbox-controller.Dockerfile -t ${CONTROLLER_IMG} .

.PHONY: docker-pushx-controller
docker-pushx-controller: ## Build and push multi-platform docker image for agent-sandbox-controller.
docker buildx build --platform=$(PLATFORMS) -f dockerfiles/agent-sandbox-controller.Dockerfile -t ${CONTROLLER_IMG} --push .

.PHONY: docker-build-manager
docker-build-manager: ## Build docker image for sandbox-manager.
docker build -f dockerfiles/sandbox-manager.Dockerfile -t ${MANAGER_IMG} .

.PHONY: docker-buildx-manager
docker-buildx-manager: ## Build multi-platform docker image for sandbox-manager.
docker buildx build --platform=$(PLATFORMS) -f dockerfiles/sandbox-manager.Dockerfile -t ${MANAGER_IMG} .

.PHONY: docker-pushx-manager
docker-pushx-manager: ## Build and push multi-platform docker image for sandbox-manager.
docker buildx build --platform=$(PLATFORMS) -f dockerfiles/sandbox-manager.Dockerfile -t ${MANAGER_IMG} --push .

.PHONY: docker-build-runtime
docker-build-runtime: ## Build docker image for agent-runtime.
docker build -f dockerfiles/agent-runtime.Dockerfile -t ${RUNTIME_IMG} .

.PHONY: docker-buildx-runtime
docker-buildx-runtime: ## Build multi-platform docker image for agent-runtime.
docker buildx build --platform=$(PLATFORMS) -f dockerfiles/agent-runtime.Dockerfile -t ${RUNTIME_IMG} .

.PHONY: docker-pushx-runtime
docker-pushx-runtime: ## Build and push multi-platform docker image for agent-runtime.
docker buildx build --platform=$(PLATFORMS) -f dockerfiles/agent-runtime.Dockerfile -t ${RUNTIME_IMG} --push .

.PHONY: build-sandbox-gateway
build-sandbox-gateway: ## Build sandbox-gateway plugin binary.
CGO_ENABLED=1 go build -buildmode=c-shared -trimpath -ldflags="-s -w" -o $(GATEWAY_SO_FILE) ./cmd/sandbox-gateway/.
Expand All @@ -143,6 +168,14 @@ build-sandbox-gateway: ## Build sandbox-gateway plugin binary.
docker-build-sandbox-gateway: ## Build docker image for sandbox-gateway.
docker build -f dockerfiles/sandbox-gateway.Dockerfile -t ${GATEWAY_IMG} .

.PHONY: docker-buildx-sandbox-gateway
docker-buildx-sandbox-gateway: ## Build multi-platform docker image for sandbox-gateway.
docker buildx build --platform=$(PLATFORMS) -f dockerfiles/sandbox-gateway.Dockerfile -t ${GATEWAY_IMG} .

.PHONY: docker-pushx-sandbox-gateway
docker-pushx-sandbox-gateway: ## Build and push multi-platform docker image for sandbox-gateway.
docker buildx build --platform=$(PLATFORMS) -f dockerfiles/sandbox-gateway.Dockerfile -t ${GATEWAY_IMG} --push .

.PHONY: build-traffic-extension
build-traffic-extension: ## Build traffic-extension binary.
go build -o bin/traffic-extension ./cmd/traffic-extension
Expand All @@ -151,6 +184,14 @@ build-traffic-extension: ## Build traffic-extension binary.
docker-build-traffic-extension: ## Build docker image for traffic-extension.
docker build -f dockerfiles/traffic-extension.Dockerfile -t ${TRAFFIX_EXTENSION_IMG} .

.PHONY: docker-buildx-traffic-extension
docker-buildx-traffic-extension: ## Build multi-platform docker image for traffic-extension.
docker buildx build --platform=$(PLATFORMS) -f dockerfiles/traffic-extension.Dockerfile -t ${TRAFFIX_EXTENSION_IMG} .

.PHONY: docker-pushx-traffic-extension
docker-pushx-traffic-extension: ## Build and push multi-platform docker image for traffic-extension.
docker buildx build --platform=$(PLATFORMS) -f dockerfiles/traffic-extension.Dockerfile -t ${TRAFFIX_EXTENSION_IMG} --push .

ifndef ignore-not-found
ignore-not-found = false
endif
Expand Down Expand Up @@ -281,4 +322,4 @@ endef
GINKGO_VERSION=v2.27.3
GINKGO = $(shell pwd)/bin/ginkgo
ginkgo: ## Download ginkgo locally if necessary.
$(call go-install-tool,$(GINKGO),github.com/onsi/ginkgo/v2/ginkgo,$(GINKGO_VERSION))
$(call go-install-tool,$(GINKGO),github.com/onsi/ginkgo/v2/ginkgo,$(GINKGO_VERSION))
6 changes: 4 additions & 2 deletions dockerfiles/agent-runtime.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
FROM golang:1.25-alpine AS builder
ARG TARGETOS
ARG TARGETARCH

# Install dependencies
RUN apk update && apk add --no-cache git curl bash

RUN cd src && git clone https://github.com/e2b-dev/infra -b 2025.33
RUN cd src/infra/packages/envd && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o bin/envd
RUN cd src/infra/packages/envd && CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o bin/envd

FROM alpine:3.21 AS runtime
WORKDIR /workspace
COPY --from=builder /go/src/infra/packages/envd/bin/envd /workspace/envd
COPY "../cmd/agent-runtime/entrypoint.sh" /workspace/entrypoint.sh
COPY ../pkg/agent-runtime/envd-run.sh /workspace/envd-run.sh
ENTRYPOINT ["sh", "/workspace/entrypoint.sh"]
ENTRYPOINT ["sh", "/workspace/entrypoint.sh"]
4 changes: 3 additions & 1 deletion dockerfiles/sandbox-manager.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Build stage
FROM golang:1.25 AS builder
ARG TARGETOS
ARG TARGETARCH

WORKDIR /app

Expand All @@ -18,7 +20,7 @@ COPY ../proto ./proto
COPY ../test ./test

# Build the binary
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o sandbox-manager ./cmd/sandbox-manager
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -installsuffix cgo -o sandbox-manager ./cmd/sandbox-manager

# Final stage
FROM alpine:3.20 AS runtime
Expand Down
Loading