forked from openkruise/agents
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommit-job.Dockerfile
More file actions
31 lines (25 loc) · 858 Bytes
/
Copy pathcommit-job.Dockerfile
File metadata and controls
31 lines (25 loc) · 858 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Build the commit-job binary
FROM golang:1.25 AS builder
ARG TARGETOS
ARG TARGETARCH
ARG VERSION
ARG NERDCTL_BRANCH
WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# Copy the go source
COPY cmd/commit-job/ cmd/commit-job/
COPY api api/
COPY pkg pkg/
COPY client client/
# Build
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -ldflags "-X main.version=${VERSION}" -a -o commit-job ./cmd/commit-job
WORKDIR /workspace/nerdctl-builder
RUN git clone -b ${NERDCTL_BRANCH:-v2.0.0} https://github.com/containerd/nerdctl.git
RUN cd nerdctl && CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} make
FROM alpine:3.20
WORKDIR /
COPY --from=builder /workspace/commit-job .
COPY --from=builder /workspace/nerdctl-builder/nerdctl/_output/nerdctl /usr/bin/nerdctl
ENTRYPOINT ["/commit-job"]