Skip to content

Commit

Permalink
Install latest rustc/cargo
Browse files Browse the repository at this point in the history
The cryptography Python package requires rustc >= 1.65.0 to build
now, and Debian only comes with 1.63.0 by default. We therefore
utilize the rustup installation script, similar to the get-pip.py
script, to get the latest version.
  • Loading branch information
JonasAlfredsson committed Aug 13, 2024
1 parent 868123b commit 8d83886
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
12 changes: 9 additions & 3 deletions src/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ RUN set -ex && \
apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
cargo \
curl \
libffi8 \
libffi-dev \
Expand All @@ -45,6 +44,12 @@ RUN set -ex && \
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 uname -m | grep -E -q '^(aarch|arm)'; then \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
export PATH="$HOME/.cargo/bin:$PATH"; \
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 +59,19 @@ RUN set -ex && \
# 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 uname -m | grep -E -q '^(aarch|arm)'; 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
4 changes: 0 additions & 4 deletions src/Dockerfile-alpine
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ RUN set -ex && \
# Install packages necessary during the build phase (for all architectures).
apk add --no-cache \
bash \
cargo \
curl \
findutils \
libffi \
Expand All @@ -54,14 +53,11 @@ RUN set -ex && \
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

0 comments on commit 8d83886

Please sign in to comment.