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.

75 lines
1.5 KiB

7 years ago
4 years ago
7 years ago
7 years ago
5 years ago
7 years ago
  1. FROM alpine:3.12
  2. RUN apk update -f \
  3. && apk --no-cache add -f \
  4. openssl \
  5. openssh-client \
  6. coreutils \
  7. bind-tools \
  8. curl \
  9. sed \
  10. socat \
  11. tzdata \
  12. oath-toolkit-oathtool \
  13. tar \
  14. libidn \
  15. && rm -rf /var/cache/apk/*
  16. ENV LE_CONFIG_HOME /acme.sh
  17. ARG AUTO_UPGRADE=1
  18. ENV AUTO_UPGRADE $AUTO_UPGRADE
  19. #Install
  20. ADD ./ /install_acme.sh/
  21. RUN cd /install_acme.sh && ([ -f /install_acme.sh/acme.sh ] && /install_acme.sh/acme.sh --install || curl https://get.acme.sh | sh) && rm -rf /install_acme.sh/
  22. RUN ln -s /root/.acme.sh/acme.sh /usr/local/bin/acme.sh && crontab -l | grep acme.sh | sed 's#> /dev/null##' | crontab -
  23. RUN for verb in help \
  24. version \
  25. install \
  26. uninstall \
  27. upgrade \
  28. issue \
  29. signcsr \
  30. deploy \
  31. install-cert \
  32. renew \
  33. renew-all \
  34. revoke \
  35. remove \
  36. list \
  37. showcsr \
  38. install-cronjob \
  39. uninstall-cronjob \
  40. cron \
  41. toPkcs \
  42. toPkcs8 \
  43. update-account \
  44. register-account \
  45. create-account-key \
  46. create-domain-key \
  47. createCSR \
  48. deactivate \
  49. deactivate-account \
  50. set-notify \
  51. set-default-ca \
  52. ; do \
  53. 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} \
  54. ; done
  55. RUN printf "%b" '#!'"/usr/bin/env sh\n \
  56. if [ \"\$1\" = \"daemon\" ]; then \n \
  57. trap \"echo stop && killall crond && exit 0\" SIGTERM SIGINT \n \
  58. crond && while true; do sleep 1; done;\n \
  59. else \n \
  60. exec -- \"\$@\"\n \
  61. fi" >/entry.sh && chmod +x /entry.sh
  62. VOLUME /acme.sh
  63. ENTRYPOINT ["/entry.sh"]
  64. CMD ["--help"]