|
| 1 | +# Detect the drift from the upstream Dockerfile |
| 2 | +FROM registry.access.redhat.com/ubi9/ubi-minimal:latest AS drift |
| 3 | +WORKDIR /app |
| 4 | +COPY drift-cache/Dockerfile Dockerfile.cached |
| 5 | +COPY Dockerfile.openshift Dockerfile |
| 6 | +# If the command below fails it means that the Dockerfile from this repository changed. |
| 7 | +# You have to update the Konflux Containerfile accordingly. |
| 8 | +# drift-cache/Dockerfile can be updated with the upstream contents once the Konflux version is aligned. |
| 9 | +RUN ["/opt/cov-sa-2019.09/bin/cov-build", "--dir=/cov", "--append-log", "sh", "-c", "[ \"$(sha1sum Dockerfile.cached | cut -d' ' -f1)\" = \"$(sha1sum Dockerfile | cut -d' ' -f1)\" ]"] |
| 10 | + |
| 11 | +FROM registry.access.redhat.com/ubi9/go-toolset:1.22 as builder |
| 12 | +# dummy copy to trigger the drift detection |
| 13 | +COPY --from=drift /app/Dockerfile.cached . |
| 14 | +WORKDIR /workspace |
| 15 | +# Dummy RUN to create /workspace directory. |
| 16 | +# WORKDIR doesn't create the directory (at least for Podman). |
| 17 | +# Without this step, the following COPY may create /workspace |
| 18 | +# as root-owned (instead of go-toolset's default 1001) |
| 19 | +# leading to "Permission denied" errors during "make build" |
| 20 | +# when trying to write output. |
| 21 | +RUN ["/opt/cov-sa-2019.09/bin/cov-build", "--dir=/cov", "--append-log", "sh", "-c", "ls ."] |
| 22 | +COPY . /workspace |
| 23 | +RUN ["/opt/cov-sa-2019.09/bin/cov-build", "--dir=/cov", "--append-log", "sh", "-c", "git config --global --add safe.directory /workspace"] |
| 24 | +# Build |
| 25 | +RUN ["/opt/cov-sa-2019.09/bin/cov-build", "--dir=/cov", "--append-log", "sh", "-c", "make build"] |
| 26 | + |
| 27 | +FROM registry.redhat.io/rhel9-4-els/rhel:9.4-943.1729773477 |
| 28 | +LABEL maintainer="Red Hat, Inc." |
| 29 | +LABEL com.redhat.component="external-dns-container" |
| 30 | +LABEL name="external-dns" |
| 31 | +LABEL version="1.3.0" |
| 32 | +LABEL commit="76d92ad82b22c92c191a8c0145d3712e4012d987" |
| 33 | +WORKDIR / |
| 34 | +COPY --from=builder /workspace/build/external-dns / |
| 35 | +COPY LICENSE /licenses/ |
| 36 | +USER 65532:65532 |
| 37 | +ENTRYPOINT ["/external-dns"] |
0 commit comments