Browse Source

refactor: adapt image build order; pin mime tools pkg version

Fabian Peter Hammerle 4 years ago
parent
commit
f5bc58bc0a
2 changed files with 15 additions and 17 deletions
  1. 14 17
      Dockerfile
  2. 1 0
      serve-gpgit.sh

+ 14 - 17
Dockerfile

@@ -11,13 +11,19 @@ RUN git clone "$GPGIT_CLONE_URL" /tmp/gpgit \
 FROM alpine:3.11 as service
 ARG CPANM_PACKAGE_VERSION=1.7044-r1
 ARG GNUPG_PACKAGE_VERSION=2.2.19-r0
-# ARG PERL_MIME_VERSION=3.031-r1
+ARG PERL_MIME_TOOLS_PACKAGE_VERSION=5.509-r1
 ARG SOCAT_PACKAGE_VERSION=1.7.3.3-r1
 ARG TINI_PACKAGE_VERSION=0.18.0-r0
 ENV GNUPGHOME=/gnupg_home
 RUN apk add --no-cache \
         gnupg=$GNUPG_PACKAGE_VERSION \
         perl-app-cpanminus=$CPANM_PACKAGE_VERSION \
+        perl-class-tiny \
+        perl-list-moreutils \
+        perl-mime-tools=$PERL_MIME_TOOLS_PACKAGE_VERSION \
+        perl-moo \
+        perl-strictures \
+        perl-type-tiny \
         socat=$SOCAT_PACKAGE_VERSION \
         tini=$TINI_PACKAGE_VERSION \
     && adduser -S gpgit \
@@ -26,36 +32,27 @@ RUN apk add --no-cache \
     && chmod 700 "$GNUPGHOME"
 VOLUME $GNUPGHOME
 ARG PERL_MAIL_GNUPG_VERSION=0.23
-# Scalar-List-Utils-1.54 > libc-dev (sys/types.h) 
+# Scalar-List-Utils-1.54 > libc-dev (sys/types.h)
 ARG PERL_MAIL_GNUPG_BUILD_PKGS="\
     gcc \
     libc-dev \
     make \
     perl-dev \
     perl-module-build \
+    perl-scalar-list-utils \
+    perl-test-pod \
     wget"
-RUN apk add --no-cache \
-        $PERL_MAIL_GNUPG_BUILD_PKGS \
-        perl-class-tiny \
-        perl-list-moreutils \
-        perl-mime-tools \
-        perl-moo \
-        perl-scalar-list-utils \
-        perl-strictures \
-        perl-test-pod \
-        perl-type-tiny \
-    && (cpanm --notest Mail::GnuPG@$PERL_MAIL_GNUPG_VERSION \
-        || (cat /root/.cpanm/work/*/build.log; exit 1)) \
+RUN apk add --no-cache $PERL_MAIL_GNUPG_BUILD_PKGS \
+    && cpanm --notest Mail::GnuPG@$PERL_MAIL_GNUPG_VERSION \
     && apk del $PERL_MAIL_GNUPG_BUILD_PKGS
 ARG GPGIT_PATH=/usr/local/bin/gpgit
 COPY --from=download /tmp/gpgit/gpgit $GPGIT_PATH
 ENV GNUPG_IMPORT=""
-ENTRYPOINT ["tini", "--"]
+ENV RECIPIENTS="gpgit@dev.null"
 COPY serve-gpgit.sh /
 RUN chmod a+rx /serve-gpgit.sh
 USER gpgit
 # [string.ascii_lowercase.index(c) for c in 'gpgit']
+ENTRYPOINT ["tini", "--"]
 EXPOSE 6156/tcp
-# log level: notice
-ENV RECIPIENTS="gpgit@dev.null"
 CMD ["/serve-gpgit.sh"]

+ 1 - 0
serve-gpgit.sh

@@ -8,4 +8,5 @@ for fingerprint in $(gpg --list-keys --with-colons | grep '^fpr:' | cut -d ':' -
     echo -e '5\ny\n' | gpg --command-fd 0 --batch --edit-key $fingerprint trust
 done
 
+# log level: notice
 exec socat -d -d -T4 tcp-l:6156,fork "exec:gpgit $RECIPIENTS"