Update Dockerfile

Signed-off-by: Kjeld Schouten <info@kjeldschouten.nl>
This commit is contained in:
Kjeld Schouten
2025-01-25 17:06:44 +01:00
committed by GitHub
parent 627b56b79c
commit 8f05d33288
+29 -20
View File
@@ -1,35 +1,44 @@
# hadolint ignore=DL3007
FROM tccr.io/tccr/alpine:latest@sha256:ec64547ad03f8d44c8d361fb3542df8cfe1012d8d79fe13fbb7ba977f07f6d7c
FROM ubuntu:latest
ARG TARGETPLATFORM
ARG VERSION
USER root
SHELL ["/bin/sh", "-o", "pipefail", "-c"]
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3008,DL3015,SC2086,SC2155,DL4001
RUN \
apk update && \
apk add --no-cache \
curl \
ca-certificates \
gnupg \
bash && \
curl -fsSLo /etc/apk/keys/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg && \
echo "https://dl-cdn.alpinelinux.org/alpine/v3.16/community" >> /etc/apk/repositories && \
curl -fsSL https://downloads.mongodb.com/compass/mongosh-1.8.0-linux-x64.tgz -o /tmp/mongosh.tgz && \
tar -xvzf /tmp/mongosh.tgz -C /tmp && \
mv /tmp/mongosh*/bin/mongosh /usr/local/bin/ && \
chmod +x /usr/local/bin/mongosh && \
apk del gnupg && \
curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg \
&& \
echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | tee /etc/apt/sources.list.d/kubernetes.list \
&& \
wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | apt-key add - \
&& \
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-6.0.list \
&& \
case "${TARGETPLATFORM}" in \
'linux/amd64') export ARCH='linux-x64' ;; \
esac && \
rm -rf /tmp/* /var/cache/apk/* && \
chmod -R u=rwX,go=rX /app && \
printf "umask %d" "${UMASK}" >> /etc/profile && \
update-ca-certificates
esac \
&& \
apt-get -qq update \
&& \
apt-get -qq install -y \
mongodb-mongosh \
&& apt-get remove -y \
jq \
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
&& apt-get autoremove -y \
&& apt-get clean \
&& \
rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/ \
&& chmod -R u=rwX,go=rX /app \
&& printf "umask %d" "${UMASK}" >> /etc/bash.bashrc \
&& update-ca-certificates
USER apps