-
Notifications
You must be signed in to change notification settings - Fork 89
Expand file tree
/
Copy pathDockerfile.cli
More file actions
35 lines (25 loc) · 839 Bytes
/
Dockerfile.cli
File metadata and controls
35 lines (25 loc) · 839 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
32
33
34
35
ARG GO_IMAGE_BASE_TAG=1.25
FROM --platform=$BUILDPLATFORM golang:${GO_IMAGE_BASE_TAG} AS builder
ARG TARGETARCH
RUN apt update && apt install -y jq
WORKDIR /go/src/app
COPY go.mod .
COPY go.sum .
RUN --mount=type=cache,target=/go/pkg/mod \
go mod download
COPY . .
ENV CGO_ENABLED=0
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
make -B build-cli GOARCH=$TARGETARCH
# Use scratch for minimal image size
FROM scratch
LABEL \
org.opencontainers.image.title="Skupper CLI" \
org.opencontainers.image.description="Provide users with the ability to operate their Skupper resources."
WORKDIR /app
# Copy the statically linked binary
COPY --from=builder /go/src/app/skupper .
# Use numeric user ID (no need to create user in scratch)
USER 10000
ENTRYPOINT ["/app/skupper"]