Dockerfile 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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_TOOLS_PACKAGE_VERSION=5.509-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. perl-class-tiny \
  21. perl-list-moreutils \
  22. perl-mime-tools=$PERL_MIME_TOOLS_PACKAGE_VERSION \
  23. perl-moo \
  24. perl-strictures \
  25. perl-type-tiny \
  26. socat=$SOCAT_PACKAGE_VERSION \
  27. tini=$TINI_PACKAGE_VERSION \
  28. && adduser -S gpgit \
  29. && mkdir -p "$GNUPGHOME" \
  30. && chown gpgit "$GNUPGHOME" \
  31. && chmod 700 "$GNUPGHOME"
  32. VOLUME $GNUPGHOME
  33. ARG PERL_MAIL_GNUPG_VERSION=0.23
  34. # Scalar-List-Utils-1.54 > libc-dev (sys/types.h)
  35. ARG PERL_MAIL_GNUPG_BUILD_PKGS="\
  36. gcc \
  37. libc-dev \
  38. make \
  39. perl-dev \
  40. perl-module-build \
  41. perl-scalar-list-utils \
  42. perl-test-pod \
  43. wget"
  44. RUN apk add --no-cache $PERL_MAIL_GNUPG_BUILD_PKGS \
  45. && cpanm --notest Mail::GnuPG@$PERL_MAIL_GNUPG_VERSION \
  46. && apk del $PERL_MAIL_GNUPG_BUILD_PKGS
  47. ARG GPGIT_PATH=/usr/local/bin/gpgit
  48. COPY --from=download /tmp/gpgit/gpgit $GPGIT_PATH
  49. ENV GNUPG_IMPORT=""
  50. COPY serve-gpgit.sh invoke-gpgit.sh /
  51. RUN chmod -c a+rx /serve-gpgit.sh /invoke-gpgit.sh
  52. USER gpgit
  53. # [string.ascii_lowercase.index(c) for c in 'gpgit']
  54. ENTRYPOINT ["tini", "--"]
  55. EXPOSE 6156/tcp
  56. CMD ["/serve-gpgit.sh"]