From 05345a3f732d546043bf0a9e9a175e3f78f4c23d Mon Sep 17 00:00:00 2001 From: Paulo Gomes Date: Thu, 24 Oct 2024 19:37:27 +0100 Subject: [PATCH 1/2] Change the generated image to `bci-busybox:15.6` (#252) --- package/Dockerfile | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/package/Dockerfile b/package/Dockerfile index ec46b4f5f..a8d79d862 100644 --- a/package/Dockerfile +++ b/package/Dockerfile @@ -1,25 +1,39 @@ -FROM registry.suse.com/bci/bci-base:15.6 +ARG BCI_VERSION=15.6 -ENV SSL_CERT_DIR /etc/rancher/ssl +FROM registry.suse.com/bci/bci-busybox:${BCI_VERSION} AS final +FROM registry.suse.com/bci/bci-base:${BCI_VERSION} AS builder + +# Creates the base dir for the target image, and hydrates it with the +# final image's contents. +RUN mkdir /chroot +COPY --from=final / /chroot/ -RUN zypper -n update && \ - zypper -n install git-core curl ca-certificates unzip mkisofs xz gzip sed tar openssh-clients && \ +RUN zypper --non-interactive refresh && \ + zypper --installroot /chroot -n rm busybox-less && \ + zypper --installroot /chroot -n install \ + git-core curl mkisofs openssh-clients openssl patterns-base-fips && \ zypper -n clean -a && \ - rm -rf /tmp/* /var/tmp/* /usr/share/doc/packages/* + rm -rf /chroot/tmp/* /chroot/var/tmp/* /chroot/usr/share/doc/packages/* RUN useradd -u 1000 machine +RUN cp /etc/passwd /chroot/etc/passwd + +COPY download_driver.sh /chroot/usr/local/bin/ +RUN chmod +x /chroot/usr/local/bin/download_driver.sh + +COPY rancher-machine entrypoint.sh /chroot/usr/local/bin/ +RUN chmod 0755 /chroot/usr/local/bin + +FROM scratch + +ENV SSL_CERT_DIR /etc/rancher/ssl + +COPY --from=builder /chroot / RUN mkdir -p .docker/machine/machines /etc/rancher/ssl /home/machine && \ chown -R machine /etc/rancher/ssl && \ chown -R machine /home/machine -COPY download_driver.sh /usr/local/bin/ -RUN chmod +x /usr/local/bin/download_driver.sh - -COPY rancher-machine entrypoint.sh /usr/local/bin/ -RUN chmod 0777 /usr/local/bin - USER 1000 -WORKDIR /home/machine ENTRYPOINT ["entrypoint.sh"] From 095d683b480729a20749c4c3542dc616fa6907eb Mon Sep 17 00:00:00 2001 From: Jiaqi Luo <6218999+jiaqiluo@users.noreply.github.com> Date: Wed, 13 Nov 2024 15:31:19 -0700 Subject: [PATCH 2/2] fix the issue where downloading node driver fails --- package/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package/Dockerfile b/package/Dockerfile index a8d79d862..f160a2a82 100644 --- a/package/Dockerfile +++ b/package/Dockerfile @@ -32,8 +32,10 @@ COPY --from=builder /chroot / RUN mkdir -p .docker/machine/machines /etc/rancher/ssl /home/machine && \ chown -R machine /etc/rancher/ssl && \ - chown -R machine /home/machine + chown -R machine /home/machine && \ + chown machine /usr/local/bin USER 1000 +WORKDIR /home/machine ENTRYPOINT ["entrypoint.sh"]