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

Re-add "Change the generated image to bci-busybox:15.6 (#252)" with additional fixes #311

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
40 changes: 28 additions & 12 deletions package/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +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
pjbgf marked this conversation as resolved.
Show resolved Hide resolved

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 /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

COPY download_driver.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/download_driver.sh
FROM scratch

COPY rancher-machine entrypoint.sh /usr/local/bin/
RUN chmod 0777 /usr/local/bin
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 && \
pjbgf marked this conversation as resolved.
Show resolved Hide resolved
chown -R machine /home/machine && \
chown machine /usr/local/bin
pjbgf marked this conversation as resolved.
Show resolved Hide resolved

USER 1000
WORKDIR /home/machine
Expand Down
Loading