You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
1.9 KiB

7 years ago
8 years ago
6 years ago
8 years ago
  1. FROM alpine:3.17
  2. RUN apk --no-cache add -f \
  3. openssl \
  4. openssh-client \
  5. coreutils \
  6. bind-tools \
  7. curl \
  8. sed \
  9. socat \
  10. tzdata \
  11. oath-toolkit-oathtool \
  12. tar \
  13. libidn \
  14. jq
  15. ENV LE_CONFIG_HOME /acme.sh
  16. ARG AUTO_UPGRADE=1
  17. ENV AUTO_UPGRADE $AUTO_UPGRADE
  18. #Install with --no-cron (cron created at first run of 'daemon')
  19. COPY ./ /install_acme.sh/
  20. RUN cd /install_acme.sh && ([ -f /install_acme.sh/acme.sh ] && /install_acme.sh/acme.sh --install --no-cron || curl https://get.acme.sh | sh) && rm -rf /install_acme.sh/
  21. RUN ln -s /root/.acme.sh/acme.sh /usr/local/bin/acme.sh && \
  22. # Install cronjob on first run. This enables each instances crontab to be randomly timed instead of random per build
  23. # Remove > /dev/null so BusyBox's crond -f will output stdout/stderr from cronjobs
  24. echo '@reboot /usr/local/bin/--install-cronjob && crontab -l | grep acme.sh | sed "s#> /dev/null##" | crontab - && crontab -l | grep -v @reboot | crontab - || /usr/local/bin/--uninstall-cronjob && crontab -l' | crontab - && \
  25. # Output crontab during build process for verification/debugging
  26. crontab -l
  27. RUN for verb in help \
  28. version \
  29. install \
  30. uninstall \
  31. upgrade \
  32. issue \
  33. signcsr \
  34. deploy \
  35. install-cert \
  36. renew \
  37. renew-all \
  38. revoke \
  39. remove \
  40. list \
  41. info \
  42. showcsr \
  43. install-cronjob \
  44. uninstall-cronjob \
  45. cron \
  46. toPkcs \
  47. toPkcs8 \
  48. update-account \
  49. register-account \
  50. create-account-key \
  51. create-domain-key \
  52. createCSR \
  53. deactivate \
  54. deactivate-account \
  55. set-notify \
  56. set-default-ca \
  57. set-default-chain \
  58. ; do \
  59. printf -- "%b" "#!/usr/bin/env sh\n/root/.acme.sh/acme.sh --${verb} --config-home /acme.sh \"\$@\"" >/usr/local/bin/--${verb} && chmod +x /usr/local/bin/--${verb} \
  60. ; done
  61. RUN printf "%b" '#!'"/usr/bin/env sh\n \
  62. if [ \"\$1\" = \"daemon\" ]; then \n \
  63. exec crond -f \n \
  64. else \n \
  65. exec -- \"\$@\"\n \
  66. fi\n" >/entry.sh && chmod +x /entry.sh
  67. VOLUME /acme.sh
  68. ENTRYPOINT ["/entry.sh"]
  69. CMD ["--help"]