forked from filanov/cluster-api-provider-agent
-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathDockerfile
More file actions
26 lines (18 loc) · 734 Bytes
/
Dockerfile
File metadata and controls
26 lines (18 loc) · 734 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
# Build the manager binary
FROM registry.access.redhat.com/ubi9/go-toolset:1.25 AS builder
USER 0
WORKDIR /workspace
COPY . .
# Build
RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -a -o manager main.go
# Extract the commit reference from which the image is built
RUN git rev-parse --short HEAD > /commit-reference.txt
FROM registry.access.redhat.com/ubi9/ubi-minimal:latest@sha256:fe688da81a696387ca53a4c19231e99289591f990c904ef913c51b6e87d4e4df
# Copy the commit reference from the builder
COPY --from=builder /commit-reference.txt /commit-reference.txt
WORKDIR /
COPY --from=builder /workspace/manager .
USER 65532:65532
ENTRYPOINT ["/manager"]
ARG QUAY_TAG_EXPIRATION
LABEL "quay.expires-after"=${QUAY_TAG_EXPIRATION}