mirror of
https://github.com/certbot/certbot.git
synced 2026-01-26 07:41:33 +03:00
This PR adds appropriate corrections to certbot dockerfile to work with the new layout (moving certbot python project in its own subdirectory). This PR has been tested with success using the `build.sh` script on a fake v1.0 version of certbot published on my fork (https://github.com/adferrand/certbot/releases/tag/v1.0) instead of archives from `certbot/certbot`.
53 lines
1.8 KiB
Docker
53 lines
1.8 KiB
Docker
# Docker Arch (amd64, arm32v6, ...)
|
|
ARG TARGET_ARCH
|
|
FROM ${TARGET_ARCH}/python:3.7-alpine3.10
|
|
|
|
# Qemu Arch (x86_64, arm, ...)
|
|
ARG QEMU_ARCH
|
|
ENV QEMU_ARCH=${QEMU_ARCH}
|
|
COPY qemu-${QEMU_ARCH}-static /usr/bin/
|
|
|
|
ARG CERTBOT_VERSION
|
|
ENV CERTBOT_VERSION=${CERTBOT_VERSION}
|
|
|
|
ENTRYPOINT [ "certbot" ]
|
|
EXPOSE 80 443
|
|
VOLUME /etc/letsencrypt /var/lib/letsencrypt
|
|
WORKDIR /opt/certbot
|
|
|
|
# Retrieve certbot code
|
|
RUN mkdir -p src \
|
|
&& wget -O certbot-${CERTBOT_VERSION}.tar.gz https://github.com/certbot/certbot/archive/v${CERTBOT_VERSION}.tar.gz \
|
|
&& tar xf certbot-${CERTBOT_VERSION}.tar.gz \
|
|
&& cp certbot-${CERTBOT_VERSION}/CHANGELOG.md certbot-${CERTBOT_VERSION}/README.rst src/ \
|
|
&& cp certbot-${CERTBOT_VERSION}/letsencrypt-auto-source/pieces/dependency-requirements.txt . \
|
|
&& cp -r certbot-${CERTBOT_VERSION}/tools tools \
|
|
&& cp -r certbot-${CERTBOT_VERSION}/acme src/acme \
|
|
&& cp -r certbot-${CERTBOT_VERSION}/certbot src/certbot \
|
|
&& rm -rf certbot-${CERTBOT_VERSION}.tar.gz certbot-${CERTBOT_VERSION}
|
|
|
|
# Generate constraints file to pin dependency versions
|
|
RUN cat dependency-requirements.txt | tools/strip_hashes.py > unhashed_requirements.txt \
|
|
&& cat tools/dev_constraints.txt unhashed_requirements.txt | tools/merge_requirements.py > docker_constraints.txt
|
|
|
|
# Install certbot runtime dependencies
|
|
RUN apk add --no-cache --virtual .certbot-deps \
|
|
libffi \
|
|
libssl1.1 \
|
|
openssl \
|
|
ca-certificates \
|
|
binutils
|
|
|
|
# Install certbot from sources
|
|
RUN apk add --no-cache --virtual .build-deps \
|
|
gcc \
|
|
linux-headers \
|
|
openssl-dev \
|
|
musl-dev \
|
|
libffi-dev \
|
|
&& pip install -r dependency-requirements.txt \
|
|
&& pip install --no-cache-dir --no-deps \
|
|
--editable src/acme \
|
|
--editable src/certbot \
|
|
&& apk del .build-deps
|