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.

[1]: rust-lang/cargo#9187
  • Loading branch information
JonasAlfredsson committed Mar 1, 2022
1 parent 7d35185 commit 50d6d0f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/nginx_secrets/
/nginx_conf.d/example_server.conf
5 changes: 5 additions & 0 deletions src/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ ENV CERTBOT_DNS_AUTHENTICATORS \
route53 \
sakuracloud

# Workaround for https://github.com/rust-lang/cargo/issues/9187
ARG CARGO_NET_GIT_FETCH_WITH_CLI true

# 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 +28,7 @@ RUN set -ex && \
build-essential \
cargo \
curl \
git \
libffi7 \
libffi-dev \
libssl-dev \
Expand All @@ -45,6 +49,7 @@ RUN set -ex && \
build-essential \
cargo \
curl \
git \
libffi-dev \
libssl-dev \
python3-dev \
Expand Down
5 changes: 5 additions & 0 deletions src/Dockerfile-alpine
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@ ENV CERTBOT_DNS_AUTHENTICATORS \
route53 \
sakuracloud

# Workaround for https://github.com/rust-lang/cargo/issues/9187
ARG CARGO_NET_GIT_FETCH_WITH_CLI true

# 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 @@ -48,6 +52,7 @@ RUN set -ex && \
apk del \
cargo \
curl \
git \
libffi-dev \
libressl-dev \
python3-dev \
Expand Down

0 comments on commit 50d6d0f

Please sign in to comment.