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.

65 lines
1.4 KiB

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