Skip to content

Commit 82fbd80

Browse files
authored
Merge pull request #2347 from drwetter/suse_docker
Switching from Alpine Image to multistaged opensuse/leap
2 parents f95d0dd + 91f3d97 commit 82fbd80

3 files changed

Lines changed: 40 additions & 11 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
* Client simulation runs in wide mode which is even better readable
3232
* Added --reqheader to support custom headers in HTTP requests
3333
* Test for support for RFC 8879 certificate compression
34+
* Doesn't hang anymore when there's no local resolver
35+
* Dockerfiles refactored to be multistaged: performance gain+address bugs/inconsistencies
3436

3537
### Features implemented / improvements in 3.0
3638

CREDITS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ Full contribution, see git log.
8484
* Hubert Kario
8585
- helped with avoiding accidental TCP fragmentation
8686

87+
* Brennan Kinney
88+
- refactored multistage Dockerfiles: performance gain+address bugs/inconsistencies
89+
8790
* Magnus Larsen
8891
- SSL Labs Rating
8992

@@ -173,6 +176,9 @@ Full contribution, see git log.
173176
* @nvsofts (NV)
174177
- LibreSSL patch for GOST
175178

179+
* @w4ntun
180+
- fixed DNS via proxy
181+
176182
Probably more I forgot to mention which did give me feedback, bug reports and helped one way or another.
177183

178184

Dockerfile

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,39 @@
1-
FROM alpine:3.17
1+
# syntax=docker.io/docker/dockerfile:1
22

3-
RUN apk update && \
4-
apk upgrade && \
5-
apk add bash procps drill git coreutils libidn curl socat openssl xxd && \
6-
rm -rf /var/cache/apk/* && \
7-
adduser -D -s /bin/bash testssl && \
8-
ln -s /home/testssl/testssl.sh /usr/local/bin/
3+
ARG LEAP_VERSION=15.4
4+
ARG INSTALL_ROOT=/rootfs
95

10-
USER testssl
11-
WORKDIR /home/testssl/
6+
FROM opensuse/leap:${LEAP_VERSION} as builder
7+
ARG CACHE_ZYPPER=/tmp/cache/zypper
8+
ARG INSTALL_ROOT
9+
# /etc/os-release provides $VERSION_ID
10+
RUN source /etc/os-release \
11+
&& export ZYPPER_OPTIONS=( --releasever "${VERSION_ID}" --installroot "${INSTALL_ROOT}" --cache-dir "${CACHE_ZYPPER}" ) \
12+
&& zypper "${ZYPPER_OPTIONS[@]}" --gpg-auto-import-keys refresh \
13+
&& zypper "${ZYPPER_OPTIONS[@]}" --non-interactive install --download-in-advance --no-recommends \
14+
bash procps grep gawk sed coreutils busybox-util-linux busybox-vi ldns libidn2-0 socat openssl curl \
15+
&& zypper "${ZYPPER_OPTIONS[@]}" clean --all
16+
## Cleanup (reclaim approx 13 MiB):
17+
# None of this content should be relevant to the container:
18+
RUN rm -r "${INSTALL_ROOT}/usr/share/"{licenses,man,locale,doc,help,info}
19+
# Functionality that the container doesn't need:
20+
RUN rm "${INSTALL_ROOT}/usr/share/misc/termcap" \
21+
&& rm -r "${INSTALL_ROOT}/usr/lib/sysimage/rpm"
22+
23+
24+
# Create a new image with the contents of $INSTALL_ROOT
25+
FROM scratch
26+
ARG INSTALL_ROOT
27+
COPY --link --from=builder ${INSTALL_ROOT} /
28+
# Create user + (home with SGID set):
29+
RUN echo 'testssl:x:1000:1000::/home/testssl:/bin/bash' >> /etc/passwd \
30+
&& echo 'testssl:x:1000:' >> /etc/group \
31+
&& echo 'testssl:!::0:::::' >> /etc/shadow \
32+
&& install --mode 2755 --owner testssl --group testssl --directory /home/testssl \
33+
&& ln -s /home/testssl/testssl.sh /usr/local/bin/
1234

1335
# Copy over build context (after filtered by .dockerignore): bin/ etc/ testssl.sh
1436
COPY --chown=testssl:testssl . /home/testssl/
15-
37+
USER testssl
1638
ENTRYPOINT ["testssl.sh"]
17-
1839
CMD ["--help"]

0 commit comments

Comments
 (0)