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.

66 lines
1.4 KiB

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