|
1 |
| -FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.16-openshift-4.8 AS builder |
2 |
| - |
3 |
| -ENV GO111MODULE auto |
4 |
| -ENV GOPATH /go |
5 |
| -ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH |
6 |
| - |
| 1 | +FROM quay.io/fedora/fedora:34-x86_64 as builder |
| 2 | +LABEL stage=builder |
7 | 3 | WORKDIR /build
|
8 | 4 |
|
| 5 | +# install dependencies and go 1.16 |
| 6 | + |
9 | 7 | # copy just enough of the git repo to parse HEAD, used to record version in OLM binaries
|
| 8 | +RUN dnf update -y && dnf install -y bash make git mercurial jq wget golang && dnf upgrade -y |
10 | 9 | COPY .git/HEAD .git/HEAD
|
11 | 10 | COPY .git/refs/heads/. .git/refs/heads
|
12 | 11 | RUN mkdir -p .git/objects
|
13 |
| - |
14 | 12 | COPY Makefile Makefile
|
15 | 13 | COPY OLM_VERSION OLM_VERSION
|
16 | 14 | COPY pkg pkg
|
17 | 15 | COPY vendor vendor
|
| 16 | +COPY go.mod go.mod |
| 17 | +COPY go.sum go.sum |
18 | 18 | COPY cmd cmd
|
19 | 19 | COPY util util
|
20 | 20 | COPY test test
|
21 |
| -COPY go.mod go.mod |
22 |
| -COPY go.sum go.sum |
23 |
| -RUN CGO_ENABLED=1 make build |
| 21 | +RUN CGO_ENABLED=0 make build |
24 | 22 | RUN make build-util
|
25 | 23 |
|
26 |
| -FROM registry.ci.openshift.org/ocp/4.8:base |
27 |
| - |
28 |
| -ADD manifests/ /manifests |
29 |
| -LABEL io.openshift.release.operator=true |
30 |
| - |
31 |
| -# Copy the binary to a standard location where it will run. |
| 24 | +# use debug tag to keep a shell around for backwards compatibility with the previous alpine image |
| 25 | +FROM gcr.io/distroless/static:debug |
| 26 | +LABEL stage=olm |
| 27 | +WORKDIR / |
| 28 | +# bundle unpack Jobs require cp at /bin/cp |
| 29 | +RUN ["/busybox/ln", "-s", "/busybox/cp", "/bin/cp"] |
32 | 30 | COPY --from=builder /build/bin/olm /bin/olm
|
33 | 31 | COPY --from=builder /build/bin/catalog /bin/catalog
|
34 | 32 | COPY --from=builder /build/bin/package-server /bin/package-server
|
35 | 33 | COPY --from=builder /build/bin/cpb /bin/cpb
|
36 |
| - |
37 |
| -# This image doesn't need to run as root user. |
38 |
| -USER 1001 |
39 |
| - |
40 | 34 | EXPOSE 8080
|
41 | 35 | EXPOSE 5443
|
42 |
| - |
43 |
| -# Apply labels as needed. ART build automation fills in others required for |
44 |
| -# shipping, including component NVR (name-version-release) and image name. OSBS |
45 |
| -# applies others at build time. So most required labels need not be in the source. |
46 |
| -# |
47 |
| -# io.k8s.display-name is required and is displayed in certain places in the |
48 |
| -# console (someone correct this if that's no longer the case) |
49 |
| -# |
50 |
| -# io.k8s.description is equivalent to "description" and should be defined per |
51 |
| -# image; otherwise the parent image's description is inherited which is |
52 |
| -# confusing at best when examining images. |
53 |
| -# |
54 |
| -LABEL io.k8s.display-name="OpenShift Operator Lifecycle Manager" \ |
55 |
| - io.k8s.description="This is a component of OpenShift Container Platform and manages the lifecycle of operators." \ |
56 |
| - maintainer= "Odin Team <[email protected]>" |
| 36 | +CMD ["/bin/olm"] |
0 commit comments