Dockerfile 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. FROM alpine:3.11 as download
  2. RUN apk add --no-cache git
  3. # https://github.com/mikecardwell/gpgit/compare/master...EtiennePerot:master
  4. ARG GPGIT_CLONE_URL=https://github.com/EtiennePerot/gpgit.git
  5. ARG GPGIT_REVISION=e9432412f2eb6aca77fb4e7bb6fad41fcbfd8632
  6. RUN git clone "$GPGIT_CLONE_URL" /tmp/gpgit \
  7. && cd /tmp/gpgit \
  8. && git checkout "$GPGIT_REVISION" \
  9. && ls -la
  10. FROM alpine:3.11 as service
  11. ARG CPANM_PACKAGE_VERSION=1.7044-r1
  12. ARG GNUPG_PACKAGE_VERSION=2.2.19-r0
  13. # ARG PERL_MIME_VERSION=3.031-r1
  14. ARG SOCAT_PACKAGE_VERSION=1.7.3.3-r1
  15. ARG TINI_PACKAGE_VERSION=0.18.0-r0
  16. ENV GNUPGHOME=/gnupg_home
  17. RUN apk add --no-cache \
  18. gnupg=$GNUPG_PACKAGE_VERSION \
  19. perl-app-cpanminus=$CPANM_PACKAGE_VERSION \
  20. socat=$SOCAT_PACKAGE_VERSION \
  21. tini=$TINI_PACKAGE_VERSION \
  22. && adduser -S gpgit \
  23. && mkdir -p "$GNUPGHOME" \
  24. && chown gpgit "$GNUPGHOME" \
  25. && chmod 700 "$GNUPGHOME"
  26. VOLUME $GNUPGHOME
  27. ARG PERL_MAIL_GNUPG_VERSION=0.23
  28. # Scalar-List-Utils-1.54 > libc-dev (sys/types.h)
  29. ARG PERL_MAIL_GNUPG_BUILD_PKGS="\
  30. gcc \
  31. libc-dev \
  32. make \
  33. perl-dev \
  34. perl-module-build \
  35. wget"
  36. RUN apk add --no-cache \
  37. $PERL_MAIL_GNUPG_BUILD_PKGS \
  38. perl-capture-tiny \
  39. perl-class-tiny \
  40. perl-list-moreutils \
  41. perl-mailtools \
  42. perl-mime-tools \
  43. perl-moo \
  44. perl-moox-types-mooselike \
  45. perl-role-tiny \
  46. perl-scalar-list-utils \
  47. perl-strictures \
  48. perl-sub-quote \
  49. perl-sub-uplevel \
  50. perl-try-tiny \
  51. perl-type-tiny \
  52. && (cpanm --notest Mail::GnuPG@$PERL_MAIL_GNUPG_VERSION \
  53. || (cat /root/.cpanm/work/*/build.log; exit 1)) \
  54. && apk del $PERL_MAIL_GNUPG_BUILD_PKGS
  55. ARG GPGIT_PATH=/usr/local/bin/gpgit
  56. COPY --from=download /tmp/gpgit/gpgit $GPGIT_PATH
  57. ENV GNUPG_IMPORT=""
  58. ENTRYPOINT ["tini", "--"]
  59. COPY serve-gpgit.sh /
  60. RUN chmod a+rx /serve-gpgit.sh
  61. USER gpgit
  62. # [string.ascii_lowercase.index(c) for c in 'gpgit']
  63. EXPOSE 6156/tcp
  64. # log level: notice
  65. ENV RECIPIENTS="gpgit@dev.null"
  66. CMD ["/serve-gpgit.sh"]