Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (37 loc) · 1.39 KB
/
Copy pathDockerfile
File metadata and controls
51 lines (37 loc) · 1.39 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
FROM golang:1.26.11-alpine3.23@sha256:23f198931d4bd83b4f5a613bd75656257ae8bf832dcbc2db80e1050b5219ca2a AS builder
WORKDIR /operator
RUN apk add --update --no-cache bash curl git make
ARG TARGETOS
ARG TARGETARCH
ARG IMAGE_REGISTRY=ghcr.io/eclipse-iofog
ARG OPERATOR_COMPONENT_LABEL_DOMAIN=iofog.org
ENV GOOS=$TARGETOS \
GOARCH=$TARGETARCH \
IMAGE_REGISTRY=$IMAGE_REGISTRY \
OPERATOR_COMPONENT_LABEL_DOMAIN=$OPERATOR_COMPONENT_LABEL_DOMAIN
COPY ./go.* ./
COPY ./Makefile ./
RUN make controller-gen
COPY ./main.go ./
COPY ./apis/ ./apis/
COPY ./internal/ ./internal/
COPY ./controllers/ ./controllers/
COPY ./pkg/ ./pkg/
COPY ./hack/ ./hack/
RUN make build
RUN cp ./bin/iofog-operator /bin
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.8@sha256:f26ef64172ea61f5ac5ba4be8c5c738bf8760b22b3e5148ce7b40f7308ab32db
WORKDIR /
ARG OCI_SOURCE_REPO=https://github.com/eclipse-iofog/iofog-operator
ARG IMAGE_REGISTRY=ghcr.io/eclipse-iofog
RUN microdnf install -y shadow-utils && \
microdnf clean all
RUN useradd --uid 10000 runner
COPY LICENSE /licenses/LICENSE
COPY --from=builder /bin/iofog-operator /bin/
LABEL org.opencontainers.image.description=operator
LABEL org.opencontainers.image.source=${OCI_SOURCE_REPO}
LABEL org.opencontainers.image.url=${IMAGE_REGISTRY}/operator
LABEL org.opencontainers.image.licenses=EPL2.0
USER 10000
ENTRYPOINT ["/bin/iofog-operator", "--enable-leader-election"]