diff --git a/build/Dockerfile b/build/Dockerfile index 7c35204c..3c3b51d7 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -1,10 +1,13 @@ FROM registry.ci.openshift.org/stolostron/builder:go1.20-linux AS plugin-builder ENV POLICY_GENERATOR_TAG=v1.13.0 -WORKDIR go/src/github.com/open-cluster-management/multicloud-operators-subscription +WORKDIR /go/src/github.com/open-cluster-management/multicloud-operators-subscription COPY . . RUN make -f Makefile build +WORKDIR /go/pkg/mod/helm.sh/helm/v3@v3.11.1 +RUN CGO_ENABLED=1 make build + WORKDIR /policy-generator RUN git clone --branch=${POLICY_GENERATOR_TAG} --depth=1 \ https://github.com/open-cluster-management-io/policy-generator-plugin @@ -29,14 +32,15 @@ ENV OPERATOR=/usr/local/bin/multicluster-operators-subscription \ POLICY_GEN_ENABLE_HELM=true # install operator binary -COPY --from=plugin-builder go/src/github.com/open-cluster-management/multicloud-operators-subscription/build/_output/bin/multicluster-operators-subscription ${OPERATOR} -COPY --from=plugin-builder go/src/github.com/open-cluster-management/multicloud-operators-subscription/build/_output/bin/multicluster-operators-placementrule /usr/local/bin -COPY --from=plugin-builder go/src/github.com/open-cluster-management/multicloud-operators-subscription/build/_output/bin/uninstall-crd /usr/local/bin -COPY --from=plugin-builder go/src/github.com/open-cluster-management/multicloud-operators-subscription/build/_output/bin/appsubsummary /usr/local/bin +COPY --from=plugin-builder /go/src/github.com/open-cluster-management/multicloud-operators-subscription/build/_output/bin/multicluster-operators-subscription ${OPERATOR} +COPY --from=plugin-builder /go/src/github.com/open-cluster-management/multicloud-operators-subscription/build/_output/bin/multicluster-operators-placementrule /usr/local/bin/ +COPY --from=plugin-builder /go/src/github.com/open-cluster-management/multicloud-operators-subscription/build/_output/bin/uninstall-crd /usr/local/bin/ +COPY --from=plugin-builder /go/src/github.com/open-cluster-management/multicloud-operators-subscription/build/_output/bin/appsubsummary /usr/local/bin/ # install the policy generator Kustomize plugin RUN mkdir -p $KUSTOMIZE_PLUGIN_HOME/policy.open-cluster-management.io/v1/policygenerator COPY --from=plugin-builder /policy-generator/PolicyGenerator $KUSTOMIZE_PLUGIN_HOME/policy.open-cluster-management.io/v1/policygenerator/PolicyGenerator +COPY --from=plugin-builder /go/pkg/mod/helm.sh/helm/v3@v3.11.1/bin/helm /usr/local/bin/ COPY build/bin /usr/local/bin RUN /usr/local/bin/user_setup diff --git a/build/Dockerfile.prow b/build/Dockerfile.prow index 6c6af18f..0128e17c 100644 --- a/build/Dockerfile.prow +++ b/build/Dockerfile.prow @@ -5,6 +5,9 @@ WORKDIR /go/src/github.com/stolostron/multicluster-operators-subscription COPY . . RUN make -f Makefile.prow build +WORKDIR /go/pkg/mod/helm.sh/helm/v3@v3.11.1 +RUN CGO_ENABLED=1 make build + WORKDIR /policy-generator RUN git clone --branch=${POLICY_GENERATOR_TAG} --depth=1 \ https://github.com/open-cluster-management-io/policy-generator-plugin @@ -30,13 +33,14 @@ ENV OPERATOR=/usr/local/bin/multicluster-operators-subscription \ # install operator binary COPY --from=builder /go/src/github.com/stolostron/multicluster-operators-subscription/build/_output/bin/multicluster-operators-subscription ${OPERATOR} -COPY --from=builder /go/src/github.com/stolostron/multicluster-operators-subscription/build/_output/bin/multicluster-operators-placementrule /usr/local/bin -COPY --from=builder /go/src/github.com/stolostron/multicluster-operators-subscription/build/_output/bin/uninstall-crd /usr/local/bin -COPY --from=builder /go/src/github.com/stolostron/multicluster-operators-subscription/build/_output/bin/appsubsummary /usr/local/bin +COPY --from=builder /go/src/github.com/stolostron/multicluster-operators-subscription/build/_output/bin/multicluster-operators-placementrule /usr/local/bin/ +COPY --from=builder /go/src/github.com/stolostron/multicluster-operators-subscription/build/_output/bin/uninstall-crd /usr/local/bin/ +COPY --from=builder /go/src/github.com/stolostron/multicluster-operators-subscription/build/_output/bin/appsubsummary /usr/local/bin/ # install the policy generator Kustomize plugin RUN mkdir -p $KUSTOMIZE_PLUGIN_HOME/policy.open-cluster-management.io/v1/policygenerator COPY --from=builder /policy-generator/PolicyGenerator $KUSTOMIZE_PLUGIN_HOME/policy.open-cluster-management.io/v1/policygenerator/PolicyGenerator +COPY --from=plugin-builder /go/pkg/mod/helm.sh/helm/v3@v3.11.1/bin/helm /usr/local/bin/ COPY build/bin /usr/local/bin RUN /usr/local/bin/user_setup diff --git a/build/Dockerfile.rhtap b/build/Dockerfile.rhtap index 1f0df53e..0480b888 100644 --- a/build/Dockerfile.rhtap +++ b/build/Dockerfile.rhtap @@ -1,10 +1,13 @@ FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_8_1.20 AS plugin-builder ENV POLICY_GENERATOR_TAG=v1.13.0 -WORKDIR go/src/github.com/open-cluster-management/multicloud-operators-subscription +WORKDIR /go/src/github.com/open-cluster-management/multicloud-operators-subscription COPY . . RUN make -f Makefile build +WORKDIR /go/pkg/mod/helm.sh/helm/v3@v3.11.1 +RUN CGO_ENABLED=1 make build + WORKDIR /policy-generator RUN git clone --branch=${POLICY_GENERATOR_TAG} --depth=1 \ https://github.com/open-cluster-management-io/policy-generator-plugin @@ -29,14 +32,15 @@ ENV OPERATOR=/usr/local/bin/multicluster-operators-subscription \ POLICY_GEN_ENABLE_HELM=true # install operator binary -COPY --from=plugin-builder go/src/github.com/open-cluster-management/multicloud-operators-subscription/build/_output/bin/multicluster-operators-subscription ${OPERATOR} -COPY --from=plugin-builder go/src/github.com/open-cluster-management/multicloud-operators-subscription/build/_output/bin/multicluster-operators-placementrule /usr/local/bin -COPY --from=plugin-builder go/src/github.com/open-cluster-management/multicloud-operators-subscription/build/_output/bin/uninstall-crd /usr/local/bin -COPY --from=plugin-builder go/src/github.com/open-cluster-management/multicloud-operators-subscription/build/_output/bin/appsubsummary /usr/local/bin +COPY --from=plugin-builder /go/src/github.com/open-cluster-management/multicloud-operators-subscription/build/_output/bin/multicluster-operators-subscription ${OPERATOR} +COPY --from=plugin-builder /go/src/github.com/open-cluster-management/multicloud-operators-subscription/build/_output/bin/multicluster-operators-placementrule /usr/local/bin/ +COPY --from=plugin-builder /go/src/github.com/open-cluster-management/multicloud-operators-subscription/build/_output/bin/uninstall-crd /usr/local/bin/ +COPY --from=plugin-builder /go/src/github.com/open-cluster-management/multicloud-operators-subscription/build/_output/bin/appsubsummary /usr/local/bin/ # install the policy generator Kustomize plugin RUN mkdir -p $KUSTOMIZE_PLUGIN_HOME/policy.open-cluster-management.io/v1/policygenerator COPY --from=plugin-builder /policy-generator/PolicyGenerator $KUSTOMIZE_PLUGIN_HOME/policy.open-cluster-management.io/v1/policygenerator/PolicyGenerator +COPY --from=plugin-builder /go/pkg/mod/helm.sh/helm/v3@v3.11.1/bin/helm /usr/local/bin/ COPY build/bin /usr/local/bin RUN /usr/local/bin/user_setup