This repository has been archived by the owner on Dec 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathDockerfile
75 lines (57 loc) · 2.14 KB
/
Dockerfile
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Build the manager binary
#@follow_tag(registry.redhat.io/rhel9/go-toolset:1.19)
FROM registry.access.redhat.com/ubi9/go-toolset:1.19.13-4.1697647145 as builder
USER 0
ENV GOPATH=/go/
# Upstream sources
# Downstream comment
ENV EXTERNAL_SOURCE=.
ENV CONTAINER_SOURCE=/opt/app-root/src
WORKDIR /workspace
#/ Downstream comment
# Downstream sources
# Downstream uncomment
# ENV EXTERNAL_SOURCE=$REMOTE_SOURCES/upstream1/app/distgit/containers/rhdh-operator
# ENV CONTAINER_SOURCE=$REMOTE_SOURCES_DIR
# WORKDIR $CONTAINER_SOURCE/
#/ Downstream uncomment
COPY $EXTERNAL_SOURCE ./
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
# Downstream comment
RUN go mod download
#/ Downstream comment
# Downstream uncomment
# COPY $REMOTE_SOURCES/upstream1/cachito.env ./
# RUN source ./cachito.env && rm -f ./cachito.env && mkdir -p /workspace
#/ Downstream uncomment
# Build
RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -a -o /workspace/manager main.go
# debug
# RUN ls -la /workspace/ $CONTAINER_SOURCE/helm-backstage/charts/backstage/charts/
# NOTE: ubi-micro is not be FIPS compliant, if openssl is not installed
#@follow_tag(registry.redhat.io/ubi9/ubi-micro:9.2)
FROM registry.access.redhat.com/ubi9/ubi-micro:9.2-15.1696515526
# Upstream sources
# Downstream comment
ENV EXTERNAL_SOURCE=.
#/ Downstream comment
# Downstream sources
# Downstream uncomment
# ENV EXTERNAL_SOURCE=$REMOTE_SOURCES/upstream1/app/distgit/containers/rhdh-operator
#/ Downstream uncomment
ENV HOME=/opt/helm \
USER_NAME=helm \
USER_UID=1001
RUN echo "${USER_NAME}:x:${USER_UID}:0:${USER_NAME} user:${HOME}:/sbin/nologin" >> /etc/passwd
# Copy necessary files with the right permissions
COPY --chown=${USER_UID}:0 ${EXTERNAL_SOURCE}/watches.yaml ${HOME}/watches.yaml
COPY --chown=${USER_UID}:0 ${EXTERNAL_SOURCE}/helm-backstage/ ${HOME}/helm-backstage/
# debug
# RUN ls -la ${HOME} ${HOME}/helm-backstage/charts/backstage/charts/
# Copy manager binary
COPY --from=builder /workspace/manager .
USER ${USER_UID}
WORKDIR ${HOME}
ENTRYPOINT ["/manager"]
# append Brew metadata here