Skip to content

Commit

Permalink
[release-v0.25.1] Remove python http server from artifact image (knat…
Browse files Browse the repository at this point in the history
…ive#835)

* [release-v0.25.1] Remove python http server from artifact image

* Fix duplicate package install
  • Loading branch information
dsimansk authored Nov 8, 2021
1 parent a47ea76 commit 9a20bb4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 71 deletions.
31 changes: 16 additions & 15 deletions openshift/ci-operator/knative-images/client/Dockerfile.cliartifacts
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest
# we'd need to create WORKDIR before hand to workaround image builder issue
# on OCP 3.11 where it requires it present before referencing
RUN mkdir -p /opt/app-root/src/go/src/github.com/knative/client
FROM registry.ci.openshift.org/ocp/ubi-minimal:8 AS packager
WORKDIR /opt/app-root/src/go/src/github.com/knative/client
RUN microdnf install -y zip tar gzip python3
ADD package_cliartifacts.sh LICENSE kn-*-* serve.py ./
RUN bash package_cliartifacts.sh && \
mkdir -p /usr/share/kn/{linux_{amd64,arm64,ppc64le,s390x},macos,windows} && \
mv kn-linux-amd64.tar.gz /usr/share/kn/linux_amd64/ && \
mv kn-linux-arm64.tar.gz /usr/share/kn/linux_arm64/ && \
mv kn-linux-ppc64le.tar.gz /usr/share/kn/linux_ppc64le/ && \
mv kn-linux-s390x.tar.gz /usr/share/kn/linux_s390x/ && \
mv kn-macos-amd64.tar.gz /usr/share/kn/macos/ && \
mv kn-windows-amd64.zip /usr/share/kn/windows/
CMD ["python3", "serve.py"]

ADD package_cliartifacts.sh LICENSE kn-*-* ./
RUN microdnf install -y zip tar gzip && \
bash package_cliartifacts.sh

FROM registry.ci.openshift.org/ocp/ubi-minimal:8
WORKDIR /opt/app-root/src/go/src/github.com/knative/client
RUN mkdir -p /usr/share/kn/{linux_amd64,linux_arm64,linux_ppc64le,linux_s390x,macos,windows}

COPY --from=packager /opt/app-root/src/go/src/github.com/knative/client/kn-linux-amd64.tar.gz /usr/share/kn/linux_amd64/
COPY --from=packager /opt/app-root/src/go/src/github.com/knative/client/kn-linux-ppc64le.tar.gz /usr/share/kn/linux_ppc64le/
COPY --from=packager /opt/app-root/src/go/src/github.com/knative/client/kn-linux-s390x.tar.gz /usr/share/kn/linux_s390x/
COPY --from=packager /opt/app-root/src/go/src/github.com/knative/client/kn-macos-amd64.tar.gz /usr/share/kn/macos/
COPY --from=packager /opt/app-root/src/go/src/github.com/knative/client/kn-windows-amd64.zip /usr/share/kn/windows/
COPY --from=packager /opt/app-root/src/go/src/github.com/knative/client/LICENSE /usr/share/kn/LICENSE
56 changes: 0 additions & 56 deletions serve.py

This file was deleted.

0 comments on commit 9a20bb4

Please sign in to comment.