Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add helm CLI to image #388

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
dhaiducek marked this conversation as resolved.
Show resolved Hide resolved
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
Expand Down
10 changes: 7 additions & 3 deletions build/Dockerfile.prow
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
14 changes: 9 additions & 5 deletions build/Dockerfile.rhtap
Original file line number Diff line number Diff line change
@@ -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
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/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
Expand Down
Loading