forked from skupperproject/skupper
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.system-controller
More file actions
35 lines (25 loc) · 881 Bytes
/
Dockerfile.system-controller
File metadata and controls
35 lines (25 loc) · 881 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 system-controller GOARCH=$TARGETARCH
# Use scratch for minimal image size
FROM scratch
LABEL \
org.opencontainers.image.title="Skupper System Controller" \
org.opencontainers.image.description="Updates runtime resources for all system sites under a given user."
WORKDIR /app
# Copy the statically linked binary
COPY --from=builder /go/src/app/system-controller .
# Use numeric user ID (no need to create user in scratch)
USER 10000
ENTRYPOINT ["/app/system-controller"]