summaryrefslogtreecommitdiffstats
path: root/Dockerfile
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 17:11:11 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 17:11:11 +0000
commitba28aa09cebfba17fd16de2af6fedf7ecc76eea5 (patch)
tree44e2ff1493776a06e95c359c53a1cabca5d8a8d4 /Dockerfile
parentInitial commit. (diff)
downloadtestssl.sh-ba28aa09cebfba17fd16de2af6fedf7ecc76eea5.tar.xz
testssl.sh-ba28aa09cebfba17fd16de2af6fedf7ecc76eea5.zip
Adding upstream version 3.2~rc3+dfsg.upstream/3.2_rc3+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile40
1 files changed, 40 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..1428352
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,40 @@
+# syntax=docker.io/docker/dockerfile:1
+
+ARG LEAP_VERSION=15.4
+ARG INSTALL_ROOT=/rootfs
+
+FROM opensuse/leap:${LEAP_VERSION} as builder
+ARG CACHE_ZYPPER=/tmp/cache/zypper
+ARG INSTALL_ROOT
+# /etc/os-release provides $VERSION_ID
+RUN source /etc/os-release \
+ && export ZYPPER_OPTIONS=( --releasever "${VERSION_ID}" --installroot "${INSTALL_ROOT}" --cache-dir "${CACHE_ZYPPER}" ) \
+ && zypper "${ZYPPER_OPTIONS[@]}" --gpg-auto-import-keys refresh \
+ && zypper "${ZYPPER_OPTIONS[@]}" --non-interactive install --download-in-advance --no-recommends \
+ bash procps grep gawk sed coreutils busybox-util-linux busybox-vi ldns libidn2-0 socat openssl curl \
+ && zypper "${ZYPPER_OPTIONS[@]}" clean --all
+## Cleanup (reclaim approx 13 MiB):
+# None of this content should be relevant to the container:
+RUN rm -r "${INSTALL_ROOT}/usr/share/"{licenses,man,locale,doc,help,info}
+# Functionality that the container doesn't need:
+RUN rm "${INSTALL_ROOT}/usr/share/misc/termcap" \
+ && rm -r "${INSTALL_ROOT}/usr/lib/sysimage/rpm"
+
+
+# Create a new image with the contents of $INSTALL_ROOT
+FROM scratch
+ARG INSTALL_ROOT
+COPY --link --from=builder ${INSTALL_ROOT} /
+# Link busybox to tar, see #2403. Create user + (home with SGID set):
+RUN ln -s /usr/bin/busybox /usr/bin/tar \
+ && echo 'testssl:x:1000:1000::/home/testssl:/bin/bash' >> /etc/passwd \
+ && echo 'testssl:x:1000:' >> /etc/group \
+ && echo 'testssl:!::0:::::' >> /etc/shadow \
+ && install --mode 2755 --owner testssl --group testssl --directory /home/testssl \
+ && ln -s /home/testssl/testssl.sh /usr/local/bin/
+
+# Copy over build context (after filtered by .dockerignore): bin/ etc/ testssl.sh
+COPY --chown=testssl:testssl . /home/testssl/
+USER testssl
+ENTRYPOINT ["testssl.sh"]
+CMD ["--help"]