forked from syntasso/kratix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.pipeline-adapter
33 lines (25 loc) · 1.02 KB
/
Dockerfile.pipeline-adapter
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
32
33
FROM --platform=${TARGETPLATFORM} golang:1.19 as builder
ARG TARGETARCH
ARG TARGETOS
WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
COPY api/ api/
COPY work-creator/ work-creator/
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download
# Build work-creator binary
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} GO111MODULE=on go build -a -o work-creator work-creator/pipeline/cmd/main.go
FROM --platform=${TARGETPLATFORM} alpine
# Use rancher/kubectl to get ./kubeconfig
COPY --from=mikefarah/yq:4 /usr/bin/yq /bin/yq
WORKDIR /
COPY --from=builder /workspace/work-creator/main ./work-creator
COPY work-creator/scripts/update-status /bin/update-status
RUN apk update && apk add --no-cache curl
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.25.1/bin/linux/amd64/kubectl
RUN chmod u+x kubectl && mv kubectl /bin/kubectl
ENTRYPOINT []
CMD []