Skip to content

Commit

Permalink
Add helm CLI to image
Browse files Browse the repository at this point in the history
ref: https://issues.redhat.com/browse/ACM-9060
Signed-off-by: Dale Haiducek <19750917+dhaiducek@users.noreply.github.com>
  • Loading branch information
dhaiducek committed Feb 12, 2024
1 parent 766d357 commit 10541b5
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions build/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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/pkg/mod/helm.sh/helm/v3@v3.11.1/helm /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
RUN curl -sL https://mirror.openshift.com/pub/openshift-v4/clients/helm/latest/helm-linux-amd64 -o /usr/local/bin/helm

COPY build/bin /usr/local/bin
RUN /usr/local/bin/user_setup
Expand Down

0 comments on commit 10541b5

Please sign in to comment.