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.

71 lines
1.5 KiB

7 years ago
8 years ago
8 years ago
6 years ago
8 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. && rm -rf /var/cache/apk/*
  15. ENV LE_CONFIG_HOME /acme.sh
  16. ENV AUTO_UPGRADE 1
  17. #Install
  18. ADD ./ /install_acme.sh/
  19. 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/
  20. RUN ln -s /root/.acme.sh/acme.sh /usr/local/bin/acme.sh && crontab -l | grep acme.sh | sed 's#> /dev/null##' | crontab -
  21. RUN for verb in help \
  22. version \
  23. install \
  24. uninstall \
  25. upgrade \
  26. issue \
  27. signcsr \
  28. deploy \
  29. install-cert \
  30. renew \
  31. renew-all \
  32. revoke \
  33. remove \
  34. list \
  35. showcsr \
  36. install-cronjob \
  37. uninstall-cronjob \
  38. cron \
  39. toPkcs \
  40. toPkcs8 \
  41. update-account \
  42. register-account \
  43. create-account-key \
  44. create-domain-key \
  45. createCSR \
  46. deactivate \
  47. deactivate-account \
  48. set-notify \
  49. ; do \
  50. 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} \
  51. ; done
  52. RUN printf "%b" '#!'"/usr/bin/env sh\n \
  53. if [ \"\$1\" = \"daemon\" ]; then \n \
  54. trap \"echo stop && killall crond && exit 0\" SIGTERM SIGINT \n \
  55. crond && while true; do sleep 1; done;\n \
  56. else \n \
  57. exec -- \"\$@\"\n \
  58. fi" >/entry.sh && chmod +x /entry.sh
  59. VOLUME /acme.sh
  60. ENTRYPOINT ["/entry.sh"]
  61. CMD ["--help"]