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.

67 lines
1.5 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. && apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/community oath-toolkit-oathtool \
  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. ; do \
  46. 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} \
  47. ; done
  48. RUN printf "%b" '#!'"/usr/bin/env sh\n \
  49. if [ \"\$1\" = \"daemon\" ]; then \n \
  50. trap \"echo stop && killall crond && exit 0\" SIGTERM SIGINT \n \
  51. crond && while true; do sleep 1; done;\n \
  52. else \n \
  53. exec -- \"\$@\"\n \
  54. fi" >/entry.sh && chmod +x /entry.sh
  55. VOLUME /acme.sh
  56. ENTRYPOINT ["/entry.sh"]
  57. CMD ["--help"]