diff --git a/Dockerfile.openshift b/Dockerfile.openshift index 27f812df..3950ce69 100644 --- a/Dockerfile.openshift +++ b/Dockerfile.openshift @@ -3,39 +3,21 @@ ADD . /go/src/github.com/openshift/whereabouts WORKDIR /go/src/github.com/openshift/whereabouts ENV CGO_ENABLED=1 ENV GO111MODULE=on -RUN go build -mod vendor -o bin/whereabouts cmd/whereabouts.go -RUN go build -mod vendor -o bin/ip-control-loop cmd/controlloop/controlloop.go -RUN go build -mod vendor -o bin/node-slice-controller cmd/nodeslicecontroller/node_slice_controller.go -WORKDIR / - -FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.24-openshift-4.20 AS rhel8 -ADD . /go/src/github.com/openshift/whereabouts -WORKDIR /go/src/github.com/openshift/whereabouts -ENV CGO_ENABLED=1 -ENV GO111MODULE=on -RUN go build -mod vendor -o bin/whereabouts cmd/whereabouts.go -RUN go build -mod vendor -o bin/ip-control-loop cmd/controlloop/controlloop.go -RUN go build -mod vendor -o bin/node-slice-controller cmd/nodeslicecontroller/node_slice_controller.go +RUN go build -mod vendor -ldflags '-s -w' -o bin/whereabouts cmd/whereabouts.go +RUN go build -mod vendor -ldflags '-s -w' -o bin/ip-control-loop cmd/controlloop/controlloop.go +RUN go build -mod vendor -ldflags '-s -w' -o bin/node-slice-controller cmd/nodeslicecontroller/node_slice_controller.go WORKDIR / FROM registry.ci.openshift.org/ocp/4.20:base-rhel9 RUN mkdir -p /usr/src/whereabouts/images && \ - mkdir -p /usr/src/whereabouts/bin && \ - mkdir -p /usr/src/whereabouts/rhel9/bin && \ - mkdir -p /usr/src/whereabouts/rhel8/bin -COPY --from=rhel8 /go/src/github.com/openshift/whereabouts/entrypoint.sh /usr/src/whereabouts/bin -COPY --from=rhel8 /go/src/github.com/openshift/whereabouts/bin/whereabouts /usr/src/whereabouts/bin -COPY --from=rhel8 /go/src/github.com/openshift/whereabouts/bin/ip-control-loop /usr/src/whereabouts/bin -COPY --from=rhel8 /go/src/github.com/openshift/whereabouts/bin/node-slice-controller /usr/src/whereabouts/bin -COPY --from=rhel9 /go/src/github.com/openshift/whereabouts/bin/whereabouts /usr/src/whereabouts/rhel9/bin -COPY --from=rhel9 /go/src/github.com/openshift/whereabouts/bin/ip-control-loop /usr/src/whereabouts/rhel9/bin -COPY --from=rhel9 /go/src/github.com/openshift/whereabouts/bin/node-slice-controller /usr/src/whereabouts/rhel9/bin -COPY --from=rhel8 /go/src/github.com/openshift/whereabouts/bin/whereabouts /usr/src/whereabouts/rhel8/bin -COPY --from=rhel8 /go/src/github.com/openshift/whereabouts/bin/ip-control-loop /usr/src/whereabouts/rhel8/bin -COPY --from=rhel8 /go/src/github.com/openshift/whereabouts/bin/node-slice-controller /usr/src/whereabouts/rhel8/bin + mkdir -p /usr/src/whereabouts/bin +COPY --from=rhel9 /go/src/github.com/openshift/whereabouts/entrypoint.sh /usr/src/whereabouts/bin +COPY --from=rhel9 /go/src/github.com/openshift/whereabouts/bin/whereabouts /usr/src/whereabouts/bin +COPY --from=rhel9 /go/src/github.com/openshift/whereabouts/bin/ip-control-loop /usr/src/whereabouts/bin +COPY --from=rhel9 /go/src/github.com/openshift/whereabouts/bin/node-slice-controller /usr/src/whereabouts/bin LABEL org.opencontainers.image.source https://github.com/openshift/whereabouts LABEL io.k8s.display-name="Whereabouts CNI" \ io.k8s.description="This is a component of OpenShift Container Platform and provides a cluster-wide IPAM CNI plugin." \ io.openshift.tags="openshift" \ - maintainer="CTO Networking " \ No newline at end of file + maintainer="CTO Networking "