Coder Social home page Coder Social logo

Comments (5)

sfackler avatar sfackler commented on September 27, 2024

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.

dry4ng avatar dry4ng commented on September 27, 2024

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.

sfackler avatar sfackler commented on September 27, 2024

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.

dry4ng avatar dry4ng commented on September 27, 2024

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.

sfackler avatar sfackler commented on September 27, 2024

The image could connect to github as well - the crate downloads are on static.crates.io.

from docker-rust.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.