From d5c82c4191ac85ca9bdbb1503351489b6baf8651 Mon Sep 17 00:00:00 2001 From: Sven Gottwald <2502366+svengo@users.noreply.github.com> Date: Wed, 20 Sep 2023 08:15:15 +0200 Subject: [PATCH] Dockerfile (#41) * Cleanup Dockerfile - Remove unused ARGs - Add log lines grouping (https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#grouping-log-lines) --- Dockerfile | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 68b88ba..bb6a300 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,16 +3,12 @@ FROM alpine:3.18.3 # Build-time variables ARG TOR_VERSION=0.4.8.6 ARG TZ=Europe/Berlin -ARG BUILD_DATE -ARG VCS_REF -ARG CURL_OPTIONS="--no-progress-meter --fail --location --remote-name" WORKDIR /tmp RUN \ + echo "::group::Install required packages" && \ set -o xtrace && \ - if test -z "$TOR_VERSION" ; then echo ERROR: TOR_VERSION not provided && exit 1; fi && \ - \ apk update && \ apk add \ curl \ @@ -34,7 +30,10 @@ RUN \ xz-dev \ zlib-dev \ zstd-dev && \ + echo "::endgroup::" && \ \ + echo "::group::Download Tor" && \ + CURL_OPTIONS="--no-progress-meter --fail --location --remote-name" && \ curl ${CURL_OPTIONS} "https://dist.torproject.org/tor-${TOR_VERSION}.tar.gz" && \ curl ${CURL_OPTIONS} "https://dist.torproject.org/tor-${TOR_VERSION}.tar.gz.sha256sum" && \ curl ${CURL_OPTIONS} "https://dist.torproject.org/tor-${TOR_VERSION}.tar.gz.sha256sum.asc" && \ @@ -43,8 +42,10 @@ RUN \ nickm@torproject.org && \ sha256sum -c "tor-${TOR_VERSION}.tar.gz.sha256sum" && \ gpg --verify "tor-${TOR_VERSION}.tar.gz.sha256sum.asc" && \ - \ tar -zxf "tor-${TOR_VERSION}.tar.gz" && \ + echo "::endgroup::" && \ + \ + echo "::group::Configure" && \ cd tor-${TOR_VERSION} && \ ./configure \ --sysconfdir=/etc \ @@ -57,16 +58,30 @@ RUN \ --enable-lzma \ --enable-zstd \ --silent && \ + echo "::endgroup::" && \ + \ + echo "::group::Build" && \ CFLAGS=-Wno-cpp make && \ + echo "::endgroup::" && \ + \ + echo "::group::Test" && \ make test && \ + echo "::endgroup::" && \ + \ + echo "::group::Install" && \ make install && \ + echo "::endgroup::" && \ \ + echo "::group::Cleanup" && \ apk del build && \ rm -rf /tmp/* && \ rm -rf /var/cache/apk/* && \ + echo "::endgroup::" && \ \ + echo "::group::Add tor user and group" && \ addgroup -S tor && \ - adduser -s /bin/false -SDH -G tor tor + adduser -s /bin/false -SDH -G tor tor && \ + echo "::endgroup::" VOLUME /data WORKDIR /data