-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile.downstream
51 lines (41 loc) · 1.45 KB
/
Dockerfile.downstream
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
# We do not use --platform feature to auto fill this ARG because of incompatibility between podman and docker
ARG TARGETARCH=amd64
ARG COMMIT
# Build the manager binary
FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:v1.22.5-202407301806.g4c8b32d.el9 as builder
ARG TARGETARCH
ARG TARGETPLATFORM
ARG VERSION="unknown"
WORKDIR /opt/app-root
COPY cmd cmd
COPY main.go main.go
COPY go.mod go.mod
COPY go.sum go.sum
COPY commands/ commands/
COPY res/ res/
COPY scripts/ scripts/
COPY vendor/ vendor/
COPY Makefile Makefile
COPY .mk/ .mk/
# Build collector
RUN GOARCH=$TARGETARCH make compile
# Embedd commands in case users want to pull it from collector image
RUN USER=netobserv VERSION=main make oc-commands
# Prepare output dir
RUN mkdir -p output
# Create final image from ubi + built binary and command
FROM --platform=linux/$TARGETARCH registry.access.redhat.com/ubi9/ubi:9.4
WORKDIR /
COPY --from=builder /opt/app-root/build .
COPY --from=builder --chown=65532:65532 /opt/app-root/output /output
USER 65532:65532
ENTRYPOINT ["/network-observability-cli"]
LABEL com.redhat.component="network-observability-cli-container"
LABEL name="network-observability-cli"
LABEL io.k8s.display-name="Network Observability CLI"
LABEL io.k8s.description="Network Observability CLI"
LABEL summary="Network Observability CLI"
LABEL maintainer="[email protected]"
LABEL io.openshift.tags="network-observability-cli"
LABEL upstream-vcs-type="git"
LABEL upstream-vcs-ref="$COMMIT"