Comments (5)
Is your network intercepting and decrypting network traffic? You'll have to add the interceptor's root certificate to the container's CA roots if so.
from docker-rust.
Same thing happens in different networks. Also curl succeeds against the same URL when building image:
Step 4/5 : RUN curl https://github.com/rust-lang/crates.io-index
---> Running in 385e449e893c
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
<!DOCTYPE html>
...
from docker-rust.
I can't reproduce this locally unfortunately:
$ cat myapp/Cargo.toml
[package]
name = "myapp"
version = "0.1.0"
authors = ["Steven Fackler <[email protected]>"]
[dependencies]
sqlite = "0.23"
$ cat Dockerfile
FROM rust:1.24.0
WORKDIR /usr/src/myapp
COPY myapp/ .
RUN cargo install
CMD ["myapp"]
$ docker build .
Sending build context to Docker daemon 15.87kB
Step 1/5 : FROM rust:1.24.0
1.24.0: Pulling from library/rust
3e731ddb7fc9: Already exists
47cafa6a79d0: Already exists
79fcf5a213c7: Already exists
68e99216b7ad: Already exists
4822563608bb: Already exists
e83f919da9f7: Pull complete
Digest: sha256:6575db28ff10d855805336895cb8303747624239bd9cffcbaa6fd50f046fa489
Status: Downloaded newer image for rust:1.24.0
---> f20935025f75
Step 2/5 : WORKDIR /usr/src/myapp
Removing intermediate container 45e4b58c60fc
---> 962f3da917d7
Step 3/5 : COPY myapp/ .
---> b7b1b173de29
Step 4/5 : RUN cargo install
---> Running in 2c767ff243fd
Installing myapp v0.1.0 (file:///usr/src/myapp)
Updating registry `https://github.com/rust-lang/crates.io-index`
Downloading sqlite v0.23.9
Downloading sqlite3-sys v0.12.0
Downloading libc v0.2.37
Downloading sqlite3-src v0.2.9
Downloading pkg-config v0.3.9
Downloading cc v1.0.4
Compiling cc v1.0.4
Compiling libc v0.2.37
Compiling pkg-config v0.3.9
Compiling sqlite3-src v0.2.9
Compiling sqlite3-sys v0.12.0
Compiling sqlite v0.23.9
Compiling myapp v0.1.0 (file:///usr/src/myapp)
Finished release [optimized] target(s) in 6.1 secs
Installing /usr/local/cargo/bin/myapp
Removing intermediate container 2c767ff243fd
---> 576fc8a307f8
Step 5/5 : CMD ["myapp"]
---> Running in e1a0ec3a29e5
Removing intermediate container e1a0ec3a29e5
---> edeb1f35749b
Successfully built edeb1f35749b
from docker-rust.
Ok I have switched to LTE network and it worked. So you were right originally. Though I still don't understand why it works for curl.
from docker-rust.
The image could connect to github as well - the crate downloads are on static.crates.io
.
from docker-rust.
Related Issues (20)
- Docker hub page update for debian:bookworm
- Builds randomly fail on Apple silicon using bind mounts with VirtioFS enabled HOT 5
- Update dockerhub page to use modern versions
- Remove $RUSTUP_HOME/share in Docker images HOT 4
- Latest Alpine images break SQL CLI build HOT 7
- When is the image rebuilt? HOT 1
- i386/rust:1.75.0 fails on Gitlab CI HOT 3
- [ FIXED ] Cannot build Rust App Docker Image because of: spurious network error ... HOT 8
- Add tags for nightly images HOT 4
- Nightly images are inaccessible HOT 1
- Missing apt sources HOT 5
- Missing apt sources HOT 3
- Docker Hub rust:alpine image fails to read crates.io with various "spurious network errors" HOT 2
- Alpine images has no layers built HOT 2
- Add user-friendly tags for Debian variants
- Missing tags for `1.77.1` images HOT 1
- 1.77.1 apt-get update fails with NO_PUBKEY
- Add s390x docker image support
- Add rpm based image
- Different architecture for 1.77.2 when using on a arm mac HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-rust.