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.

68 lines
1.4 KiB

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