Adds support for Rancher servers that use self-signed certificates

This commit is contained in:
janeczku
2017-05-14 20:44:36 +02:00
parent 8d2f8c7fdd
commit 38be438826
4 changed files with 35 additions and 14 deletions
-13
View File
@@ -1,13 +0,0 @@
FROM alpine:3.4
RUN apk add --no-cache ca-certificates
ENV LETSENCRYPT_RELEASE v0.4.0
ADD https://github.com/janeczku/rancher-letsencrypt/releases/download/${LETSENCRYPT_RELEASE}/rancher-letsencrypt-linux-amd64.tar.gz /tmp/rancher-letsencrypt.tar.gz
RUN tar -zxvf /tmp/rancher-letsencrypt.tar.gz -C /usr/bin \
&& chmod +x /usr/bin/rancher-letsencrypt
ENTRYPOINT ["/usr/bin/rancher-letsencrypt"]
EXPOSE 80
+1 -1
View File
@@ -1,4 +1,4 @@
FROM alpine:3.4
FROM alpine:3.5
RUN apk add --no-cache ca-certificates
+19
View File
@@ -0,0 +1,19 @@
FROM alpine:3.5
RUN apk add --no-cache ca-certificates openssl bash
ENV LETSENCRYPT_RELEASE v0.4.0
ENV SSL_SCRIPT_COMMIT 08278ace626ada71384fc949bd637f4c15b03b53
RUN wget -O /usr/bin/update-rancher-ssl https://raw.githubusercontent.com/rancher/rancher/${SSL_SCRIPT_COMMIT}/server/bin/update-rancher-ssl && \
chmod +x /usr/bin/update-rancher-ssl
COPY rancher-entrypoint.sh /usr/bin/
ADD https://github.com/janeczku/rancher-letsencrypt/releases/download/${LETSENCRYPT_RELEASE}/rancher-letsencrypt-linux-amd64.tar.gz /tmp/rancher-letsencrypt.tar.gz
RUN tar -zxvf /tmp/rancher-letsencrypt.tar.gz -C /usr/bin \
&& chmod +x /usr/bin/rancher-letsencrypt
EXPOSE 80
ENTRYPOINT ["/usr/bin/rancher-entrypoint.sh"]
+15
View File
@@ -0,0 +1,15 @@
#!/bin/bash
# first arg is `-flag` or `--some-flag`
if [ "${1:0:1}" = '-' ]; then
set -- /usr/bin/rancher-letsencrypt "$@"
fi
# no argument
if [ -z "$1" ]; then
set -- /usr/bin/rancher-letsencrypt
fi
/usr/bin/update-rancher-ssl
exec "$@"