This repository has been archived by the owner on Jun 11, 2022. It is now read-only.
forked from acmesh-official/acme.sh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
75 lines (63 loc) · 1.76 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
FROM alpine:3.10
WORKDIR /
RUN apk update -f \
&& apk --no-cache add -f \
openssl \
openssh-client \
coreutils \
bind-tools \
curl \
socat \
tzdata \
jq \
oath-toolkit-oathtool \
tar \
py3-pip \
&& rm -rf /var/cache/apk/*
RUN pip3 install awscli --upgrade
ENV LE_CONFIG_HOME /acme.sh
ENV AUTO_UPGRADE 1
#Install
ADD ./ /install_acme.sh/
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/
RUN ln -s /root/.acme.sh/acme.sh /usr/local/bin/acme.sh && crontab -l | grep acme.sh | sed 's#> /dev/null##' | crontab -
# This loop creates executable aliases that link to the acme.sh script, which is what allows passing commands into the container as if they were cli options for the script
# ex: --issue is the command parameter passed to the script which tells it to issue a certificate. Docker parses that --issue on the cli as a command, which is created in this loop.
RUN for verb in help \
version \
install \
uninstall \
upgrade \
issue \
signcsr \
deploy \
install-cert \
renew \
renew-all \
revoke \
remove \
list \
showcsr \
install-cronjob \
uninstall-cronjob \
cron \
toPkcs \
toPkcs8 \
update-account \
register-account \
create-account-key \
create-domain-key \
createCSR \
deactivate \
deactivate-account \
set-notify \
; do \
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} \
; done
COPY ./entry.sh .
RUN chmod +x /entry.sh
COPY ./smtp-relay-automation.sh .
RUN chmod +x /smtp-relay-automation.sh
VOLUME /acme.sh
ENTRYPOINT ["/smtp-relay-automation.sh"]
CMD ["--help"]