Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install latest rustc/cargo #282

Merged
merged 1 commit into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions src/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM nginx:1.27.0
LABEL maintainer="Jonas Alfredsson <[email protected]>"

ENV CERTBOT_DNS_AUTHENTICATORS \

Check warning on line 4 in src/Dockerfile

View workflow job for this annotation

GitHub Actions / docker_buildx_debian

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/
cloudflare \
cloudxns \
digitalocean \
Expand All @@ -24,6 +24,10 @@
# any real need to cater to other programs/environments.
ARG PIP_BREAK_SYSTEM_PACKAGES=1

# We need to do some platfrom specific workarounds in the build script, so bring
# this information in to the build environment.
ARG TARGETPLATFORM

# Through this we gain the ability to handle certbot upgrades through
# dependabot pull requests.
COPY requirements.txt /requirements.txt
Expand All @@ -34,7 +38,6 @@
apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
cargo \
curl \
libffi8 \
libffi-dev \
Expand All @@ -45,6 +48,18 @@
python3 \
python3-dev \
&& \
# Install the latest version of rustc/cargo if we are in an architecture that
# needs to build the cryptography Python package.
if echo "$TARGETPLATFORM" | grep -E -q '^(linux/386|linux/arm64|linux/arm/v7)'; then \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | /bin/sh -s -- -y \
# For some reason the rustup script is unable to correctly identify the
# environment if we are building an i386 image on an x86_64 system, so we need
# to provide this information manually.
$(if [ "$TARGETPLATFORM" = "linux/386" ]; then \
echo "--default-host i686-unknown-linux-gnu"; \
fi) && \
. "$HOME/.cargo/env"; \
fi && \
# Install the latest version of PIP, Setuptools and Wheel.
curl -L 'https://bootstrap.pypa.io/get-pip.py' | python3 && \
# Install certbot.
Expand All @@ -54,18 +69,19 @@
# Remove everything that is no longer necessary.
apt-get remove --purge -y \
build-essential \
cargo \
curl \
libffi-dev \
libssl-dev \
pkg-config \
python3-dev \
&& \
if echo "$TARGETPLATFORM" | grep -E -q '^(linux/386|linux/arm64|linux/arm/v7)'; then \
rustup self uninstall -y; \
fi && \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /root/.cache && \
rm -rf /root/.cargo && \
# Create new directories and set correct permissions.
mkdir -p /var/www/letsencrypt && \
mkdir -p /etc/nginx/user_conf.d && \
Expand Down
3 changes: 0 additions & 3 deletions src/Dockerfile-alpine
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM nginx:1.27.0-alpine
LABEL maintainer="Jonas Alfredsson <[email protected]>"

ENV CERTBOT_DNS_AUTHENTICATORS \

Check warning on line 4 in src/Dockerfile-alpine

View workflow job for this annotation

GitHub Actions / docker_buildx_alpine

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/
cloudflare \
cloudxns \
digitalocean \
Expand Down Expand Up @@ -33,7 +33,6 @@
# Install packages necessary during the build phase (for all architectures).
apk add --no-cache \
bash \
cargo \
curl \
findutils \
libffi \
Expand All @@ -54,14 +53,12 @@
pip3 install $(echo $CERTBOT_DNS_AUTHENTICATORS | sed 's/\(^\| \)/\1certbot-dns-/g') && \
# Remove everything that is no longer necessary.
apk del \
cargo \
curl \
libffi-dev \
libressl-dev \
python3-dev \
&& \
rm -rf /root/.cache && \
rm -rf /root/.cargo && \
# Create new directories and set correct permissions.
mkdir -p /var/www/letsencrypt && \
mkdir -p /etc/nginx/user_conf.d && \
Expand Down
Loading