-
Notifications
You must be signed in to change notification settings - Fork 50
Switch k9s source from GitHub to use openSUSE #294
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
base: main
Are you sure you want to change the base?
Changes from all commits
ed5f839
61ea3b8
c922ed6
264a396
83cf709
71fda9c
a5f5a31
07db657
8dd4830
c8fa6c4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,27 +43,31 @@ RUN curl --output /tmp/kustomize.tar.gz -sLf "https://github.com/kubernetes-sigs | |
| echo "${!KUSTOMIZE_SUM} /tmp/kustomize.tar.gz" | sha256sum -c - && \ | ||
| tar -xvzf /tmp/kustomize.tar.gz -C / kustomize | ||
|
|
||
| # Stage k9s into build | ||
| ENV K9S_SUM="K9S_SUM_${TARGETARCH}" | ||
| RUN curl --output /tmp/k9s.tar.gz -sLf "https://github.com/derailed/k9s/releases/download/${K9S_VERSION}/k9s_Linux_${TARGETARCH}.tar.gz" && \ | ||
| echo "${!K9S_SUM} /tmp/k9s.tar.gz" | sha256sum -c - && \ | ||
| tar -xvzf /tmp/k9s.tar.gz -C / k9s | ||
|
|
||
| FROM registry.suse.com/bci/bci-base:${BCI_VERSION} AS zypper | ||
|
|
||
| ARG BCI_VERSION=15.6 | ||
| ENV BCI_VERSION=${BCI_VERSION} | ||
|
|
||
| # Creates the based dir for the target image, and hydrates it with the | ||
| # original contents of the final image. | ||
| RUN mkdir /chroot | ||
| COPY --from=final / /chroot/ | ||
|
|
||
| # Setup repo needed to install k9s package | ||
| RUN zypper --non-interactive ar https://download.opensuse.org/repositories/devel:kubic/${BCI_VERSION}/devel:kubic.repo \ | ||
| && zypper --non-interactive ar https://download.opensuse.org/repositories/devel:/kubic/openSUSE_Factory_ARM/ devel_kubic_arm \ | ||
| && zypper --non-interactive ar https://download.opensuse.org/repositories/devel:/kubic/openSUSE_Factory_zSystems/ devel_kubic_zed \ | ||
|
mallardduck marked this conversation as resolved.
|
||
| && rpm --import https://download.opensuse.org/repositories/devel:/kubic/${BCI_VERSION}/repodata/repomd.xml.key \ | ||
| --import https://download.opensuse.org/repositories/devel:/kubic/openSUSE_Factory_ARM/repodata/repomd.xml.key \ | ||
| --import https://download.opensuse.org/repositories/devel:/kubic/openSUSE_Factory_zSystems/repodata/repomd.xml.key \ | ||
| && zypper --non-interactive refresh | ||
|
|
||
| # The final image does not contain zypper, --installroot is used to | ||
| # install all artefacts within a dir (/chroot) that can then be copied | ||
| # over to a scratch image. | ||
| RUN zypper --non-interactive refresh && \ | ||
| zypper --installroot /chroot -n rm busybox-vi busybox-links && \ | ||
| zypper --installroot /chroot -n in bash-completion jq vim curl && \ | ||
| zypper --installroot /chroot clean -a && \ | ||
| rm -rf /chroot/var/cache/zypp/* /chroot/var/log/zypp/* /chroot/etc/zypp/ | ||
| zypper --installroot /chroot -n in bash-completion jq vim curl k9s | ||
|
Comment on lines
68
to
+70
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't really understand this part, why are you installing k9s into
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dcermak The final image is largely a copy of the The copy into Given that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just install everything into the image based on
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dcermak good point, this is actually a practice we observed in other teams using OBS/IBS. Issues with the rpm scriptlets would make the zypper operation fail or would it be a silent, resulting in potential unexpected behaviours executing the installed app? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The failure could be either silent or you could end up with a broken package, it's impossible to tell in advance. You'd probably see a failure in the rpm installation log, but you'd have to inspect them manually. |
||
|
|
||
|
|
||
| RUN echo 'shell:x:1000:1000:shell,,,:/home/shell:/bin/bash' > /chroot/etc/passwd && \ | ||
|
|
@@ -84,7 +88,7 @@ FROM scratch | |
|
|
||
| COPY --from=zypper /chroot / | ||
| COPY --chown=root:root --chmod=0755 --from=helm /helm/bin/helm /usr/local/bin/ | ||
| COPY --chown=root:root --chmod=0755 --from=build /kubectl /k9s /kustomize* /usr/local/bin/ | ||
| COPY --chown=root:root --chmod=0755 --from=build /kubectl /kustomize* /usr/local/bin/ | ||
| COPY --chown=root:root --chmod=0755 package/helm-cmd package/welcome /usr/local/bin/ | ||
| COPY --chown=1000:1000 --chmod=0755 package/kustomize.sh /home/shell/ | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.