deploy/containers/kube-terminal/Dockerfile.kubeterminal
FROM splatform/stratos-bk-build-base:leap15_2 as terminal-builder
USER root
WORKDIR /root
# Kubectl versions
RUN curl -L -o kubectl_1.19 https://storage.googleapis.com/kubernetes-release/release/v1.19.2/bin/linux/amd64/kubectl
RUN curl -L -o kubectl_1.18 https://storage.googleapis.com/kubernetes-release/release/v1.18.9/bin/linux/amd64/kubectl
RUN curl -L -o kubectl_1.17 https://storage.googleapis.com/kubernetes-release/release/v1.17.12/bin/linux/amd64/kubectl
RUN curl -L -o kubectl_1.16 https://storage.googleapis.com/kubernetes-release/release/v1.16.15/bin/linux/amd64/kubectl
RUN curl -L -o kubectl_1.15 https://storage.googleapis.com/kubernetes-release/release/v1.15.12/bin/linux/amd64/kubectl
RUN curl -L -o kubectl_1.14 https://storage.googleapis.com/kubernetes-release/release/v1.14.10/bin/linux/amd64/kubectl
# Tar each one up, to save space in the image
RUN gzip kubectl_1.19
RUN gzip kubectl_1.18
RUN gzip kubectl_1.17
RUN gzip kubectl_1.16
RUN gzip kubectl_1.15
RUN gzip kubectl_1.14
# Fetch Helm 3 package
RUN curl -L -o helm.tar.gz https://get.helm.sh/helm-v3.3.4-linux-amd64.tar.gz && \
tar -xvf helm.tar.gz --strip-components=1 && \
gzip helm
RUN ls -al
# Use small base image with very little in it
FROM splatform/stratos-base:leap15_2
# Use gzip from the builder image
COPY --from=terminal-builder /usr/bin/gunzip /usr/bin/
COPY --from=terminal-builder /usr/bin/gzip /usr/bin/
RUN mkdir /stratos
# Copy the various kubectl versions
COPY --from=terminal-builder /root/helm.gz /stratos/helm.gz
COPY --from=terminal-builder /root/kubectl* /stratos/
# Run as user 'stratos'
RUN useradd -ms /bin/bash stratos -K MAIL_DIR=/dev/null
RUN chown -R stratos /stratos && \
chgrp -R users /stratos
# Remove a few packages
RUN zypper rm -y diffutils shadow fillup openssl
# Remove zypper
RUN zypper rm -y dirmngr && \
rm -rf /usr/bin/rpm*
USER stratos
WORKDIR /home/stratos
ADD ./kubeconsole.bashrc /home/stratos/.bashrc
CMD exec /bin/bash -c "trap : TERM INT; sleep infinity & wait"