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.

64 lines
1.4 KiB

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