Skip to content

Commit

Permalink
Use git via CLI when building with rust
Browse files Browse the repository at this point in the history
We get random errors, when rust is building, stating that

  failed to fetch https://github.com/rust-lang/crates.io-index

This appears to [be known][1] and will be fixed in the future. Until
then the suggested workaround is to use git that is installed on the
system instead.
  • Loading branch information
JonasAlfredsson committed Mar 1, 2022
1 parent 7d35185 commit e3d0bd4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ ENV CERTBOT_DNS_AUTHENTICATORS \
route53 \
sakuracloud

# Workaround for https://github.com/rust-lang/cargo/issues/9187
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
ENV CARGO_HTTP_DEBUG=true
ENV CARGO_LOG=trace

# Do a single run command to make the intermediary containers smaller.
RUN set -ex && \
# Install packages necessary during the build phase (for all architectures).
Expand All @@ -25,6 +30,7 @@ RUN set -ex && \
build-essential \
cargo \
curl \
git \
libffi7 \
libffi-dev \
libssl-dev \
Expand All @@ -36,6 +42,7 @@ RUN set -ex && \
# Install the latest version of PIP, Setuptools and Wheel.
curl -L 'https://bootstrap.pypa.io/get-pip.py' | python3 && \
# Install certbot.
pip --version && cargo --version --verbose && \
pip3 install -U cffi certbot \
# And the supported extra authenticators
$(echo $CERTBOT_DNS_AUTHENTICATORS | sed 's/\(^\| \)/\1certbot-dns-/g') \
Expand All @@ -45,6 +52,7 @@ RUN set -ex && \
build-essential \
cargo \
curl \
git \
libffi-dev \
libssl-dev \
python3-dev \
Expand Down
8 changes: 8 additions & 0 deletions src/Dockerfile-alpine
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,19 @@ ENV CERTBOT_DNS_AUTHENTICATORS \
route53 \
sakuracloud

# Workaround for https://github.com/rust-lang/cargo/issues/9187
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
ENV CARGO_HTTP_DEBUG=true
ENV CARGO_LOG=trace

# Do a single run command to make the intermediary containers smaller.
RUN set -ex && \
# Install packages necessary during the build phase (for all architectures).
apk add --no-cache \
cargo \
curl \
findutils \
git \
libffi \
libffi-dev \
libressl \
Expand All @@ -38,6 +44,7 @@ RUN set -ex && \
echo 'http://dl-cdn.alpinelinux.org/alpine/v3.12/main' >> /etc/apk/repositories && \
apk add --no-cache 'bash<5.1' && \
# Install the latest version of PIP, Setuptools and Wheel.
pip --version && cargo --version --verbose && \
curl -L 'https://bootstrap.pypa.io/get-pip.py' | python3 && \
# Install certbot.
pip3 install -U cffi certbot \
Expand All @@ -48,6 +55,7 @@ RUN set -ex && \
apk del \
cargo \
curl \
git \
libffi-dev \
libressl-dev \
python3-dev \
Expand Down

0 comments on commit e3d0bd4

Please sign in to comment.