2020-10-13 00:11:43 +02:00
|
|
|
FROM golang:1.15-alpine AS go-builder
|
2018-06-05 09:37:32 +02:00
|
|
|
|
2020-12-21 22:47:43 +01:00
|
|
|
ENV DOCKER_GEN_VERSION=fix-current-container-id
|
2018-06-05 09:37:32 +02:00
|
|
|
|
2020-10-20 11:45:41 +02:00
|
|
|
# Build docker-gen
|
|
|
|
RUN apk add --no-cache --virtual .build-deps \
|
2018-06-05 09:37:32 +02:00
|
|
|
curl \
|
|
|
|
gcc \
|
|
|
|
git \
|
|
|
|
make \
|
2020-10-20 11:45:41 +02:00
|
|
|
musl-dev \
|
2020-12-21 22:47:43 +01:00
|
|
|
&& go get github.com/buchdag/docker-gen \
|
|
|
|
&& mv /go/src/github.com/buchdag /go/src/github.com/jwilder \
|
2018-06-05 09:37:32 +02:00
|
|
|
&& cd /go/src/github.com/jwilder/docker-gen \
|
2020-11-17 17:52:50 +01:00
|
|
|
&& git -c advice.detachedHead=false checkout $DOCKER_GEN_VERSION \
|
2018-06-05 09:37:32 +02:00
|
|
|
&& make get-deps \
|
2020-10-20 11:45:41 +02:00
|
|
|
&& make all \
|
|
|
|
&& go clean -cache \
|
|
|
|
&& mv docker-gen /usr/local/bin/ \
|
|
|
|
&& rm -rf /go/src \
|
|
|
|
&& apk del .build-deps
|
2018-06-05 09:37:32 +02:00
|
|
|
|
2020-10-20 11:03:05 +02:00
|
|
|
FROM alpine:3.12
|
2015-12-31 18:50:25 +01:00
|
|
|
|
2020-10-20 14:10:27 +02:00
|
|
|
LABEL maintainer="Nicolas Duchon <nicolas.duchon@gmail.com> (@buchdag)"
|
2015-12-31 18:50:25 +01:00
|
|
|
|
2020-10-20 14:36:10 +02:00
|
|
|
ARG GIT_DESCRIBE
|
2020-12-06 11:56:56 +01:00
|
|
|
ARG ACMESH_VERSION=2.8.8
|
2020-11-17 23:06:14 +01:00
|
|
|
|
2020-10-20 14:36:10 +02:00
|
|
|
ENV COMPANION_VERSION=$GIT_DESCRIBE \
|
|
|
|
DOCKER_HOST=unix:///var/run/docker.sock \
|
2018-12-31 12:53:21 +01:00
|
|
|
PATH=$PATH:/app
|
2016-02-26 19:07:11 +01:00
|
|
|
|
2017-11-22 22:55:19 +01:00
|
|
|
# Install packages required by the image
|
2020-10-20 11:45:41 +02:00
|
|
|
RUN apk add --no-cache --virtual .bin-deps \
|
2017-11-22 22:55:19 +01:00
|
|
|
bash \
|
2018-12-14 15:01:27 +01:00
|
|
|
coreutils \
|
2017-11-22 22:55:19 +01:00
|
|
|
curl \
|
|
|
|
jq \
|
|
|
|
openssl \
|
2020-10-20 11:45:41 +02:00
|
|
|
socat
|
2015-12-31 18:50:25 +01:00
|
|
|
|
2018-06-05 09:37:32 +02:00
|
|
|
# Install docker-gen from build stage
|
2020-10-20 11:45:41 +02:00
|
|
|
COPY --from=go-builder /usr/local/bin/docker-gen /usr/local/bin/
|
2015-12-31 18:50:25 +01:00
|
|
|
|
2020-10-11 21:07:44 +02:00
|
|
|
# Install acme.sh
|
2018-12-31 12:53:21 +01:00
|
|
|
COPY /install_acme.sh /app/install_acme.sh
|
|
|
|
RUN chmod +rx /app/install_acme.sh \
|
2018-06-05 09:37:32 +02:00
|
|
|
&& sync \
|
2018-12-31 12:53:21 +01:00
|
|
|
&& /app/install_acme.sh \
|
|
|
|
&& rm -f /app/install_acme.sh
|
2015-12-31 18:50:25 +01:00
|
|
|
|
|
|
|
COPY /app/ /app/
|
2017-11-22 22:55:19 +01:00
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
2018-12-31 12:53:21 +01:00
|
|
|
VOLUME ["/etc/acme.sh", "/etc/nginx/certs"]
|
|
|
|
|
2017-11-22 22:55:19 +01:00
|
|
|
ENTRYPOINT [ "/bin/bash", "/app/entrypoint.sh" ]
|
|
|
|
CMD [ "/bin/bash", "/app/start.sh" ]
|