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.

63 lines
1.4 KiB

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