|
| 1 | +# Copyright 2021 Red Hat |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | +# |
| 15 | +# -- |
| 16 | + |
| 17 | +FROM registry.redhat.io/rhel8/go-toolset:1.22.7-5.1731464728 AS builder |
| 18 | + |
| 19 | +ENV LANG=en_US.utf8 |
| 20 | +ENV GIT_COMMITTER_NAME devtools |
| 21 | +ENV GIT_COMMITTER_EMAIL [email protected] |
| 22 | +LABEL com.redhat.delivery.appregistry=true |
| 23 | + |
| 24 | +WORKDIR /gitops-operator |
| 25 | + |
| 26 | +COPY go.mod go.mod |
| 27 | +COPY go.sum go.sum |
| 28 | +# cache deps before building and copying source so that we don't need to re-download as much |
| 29 | +# and so that source changes don't invalidate our downloaded layer |
| 30 | +RUN go mod download |
| 31 | + |
| 32 | +# Copy the go source |
| 33 | +COPY cmd/main.go cmd/main.go |
| 34 | +COPY api/ api/ |
| 35 | +COPY controllers/ controllers/ |
| 36 | +COPY common/ common/ |
| 37 | +COPY version/ version/ |
| 38 | + |
| 39 | +ARG VERBOSE=2 |
| 40 | +ENV GOFLAGS="-mod=mod" |
| 41 | +RUN go build -o bin/manager ./cmd/main.go |
| 42 | + |
| 43 | +FROM registry.access.redhat.com/ubi8/ubi-minimal |
| 44 | +ENV LANG=en_US.utf8 |
| 45 | +COPY --from=builder /gitops-operator/bin/manager /usr/local/bin/manager |
| 46 | +# Redis HA script templates |
| 47 | +COPY build/redis /var/lib/redis |
| 48 | +USER 10001 |
| 49 | +ENTRYPOINT [ "/usr/local/bin/manager" ] |
| 50 | + |
| 51 | +LABEL \ |
| 52 | + name="openshift-gitops-1/gitops-rhel8-operator" \ |
| 53 | + version=${TARGET_VERSION} \ |
| 54 | + License="Apache 2.0" \ |
| 55 | + com.redhat.component="openshift-gitops-operator-container" \ |
| 56 | + com.redhat.delivery.appregistry="false" \ |
| 57 | + release=${CI_CONTAINER_RELEASE} \ |
| 58 | + upstream-version=${CI_UPSTREAM_VERSION} \ |
| 59 | + upstream-vcs-ref="${COMMIT_SHA}" \ |
| 60 | + upstream-vcs-type="git" \ |
| 61 | + summary="Openshift GitOps Operator Dockerfile Template" \ |
| 62 | + maintainer="William Tam < [email protected]>" \ |
| 63 | + io.openshift.tags="openshift,gitops-operator" \ |
| 64 | + io.k8s.display-name="Red Hat OpenShift GitOps Operator" \ |
| 65 | + io.k8s.description="Red Hat OpenShift GitOps Operator" \ |
| 66 | + io.openshift.maintainer.product="Red Hat OpenShift GitOps" \ |
| 67 | + io.openshift.maintainer.component="William Tam < [email protected]>" |
| 68 | + |
0 commit comments