-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (19 loc) · 750 Bytes
/
Dockerfile
File metadata and controls
29 lines (19 loc) · 750 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
FROM --platform=$BUILDPLATFORM golang:1.20-alpine as builder
RUN apk add --no-cache bash git
WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# 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
COPY / /workspace
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN [ "$(uname)" = Darwin ] && system=darwin || system=linux; \
./ci/go-build.sh --os ${system} --arch $(echo $TARGETPLATFORM | cut -d/ -f2)
FROM --platform=$TARGETPLATFORM alpine
RUN apk add --no-cache docker-cli
COPY --from=builder /workspace/goapp /usr/bin/k3dnifi
# Run the binary.
ENTRYPOINT ["/usr/bin/k3dnifi"]