-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error: failed to get 'actix-rt' as a dependency of package #10221
Comments
Hm, I'm unfortunately unable to reproduce with that docker image. |
Thanks for looking into this ehuss. I got it resolve by running the following commands, so it seems that my cargo required these updates: cargo install cargo-vendor |
I got wrong after run "cargo vendor"
anyone can help me ? |
@Smilejohnson, what version of cargo are you using. This may be a case off #10623 |
Hello, I'm getting error whilst building a new image using Dockerfile for a Rust program.
Code in my "main.rs" as below:
use actix_web::{web, App, HttpResponse, HttpServer, Result};
#[actix_rt::main]
async fn main() -> std::io::Result<()> {
HttpServer::new(||{
App::new()
.service(web::resource("/").route(web::get().to(index)))
})
.bind("0.0.0.0:4400")?
.run()
.await
}
async fn index() -> Result {
println!("Ch13 Docker Test");
Ok(HttpResponse::Ok()
.content_type("text/html; charset=utf-8")
.body(include_str!("../static/index.html")))
}
Cargo.toml dependencies:
[dependencies]
actix-web = "2.0.0"
actix-rt = "1.0.0"
Dockerfile code:
FROM rust:1-slim-buster AS base
ENV USER = root
WORKDIR /code
#RUN cargo init
COPY Cargo.toml /code/Cargo.toml
#RUN cargo fetch
COPY src/ src/
CMD ["cargo", "test", "--offline"]
FROM base AS builder
RUN cargo build --release
FROM rust:1-slim-buster
COPY --from=builder /code/target/release/Ch13_docker_test /usr/bin/Ch13_docker_test
EXPOSE 4400
ENTRYPOINT ["/usr/bin/Ch13_docker_test"]
When I run "sudo docker build -t ch13_docker1g .", I get the following error on my terminal in Linux:
Step 8/12 : RUN cargo build --release
---> Running in 6b81f85ebb2b
Updating crates.io index
error: failed to get
actix-rt
as a dependency of packageCh13_docker_test v0.1.0 (/code)
Caused by:
failed to load source for dependency
actix-rt
Caused by:
Unable to update registry
crates-io
Caused by:
failed to fetch
https://github.com/rust-lang/crates.io-index
Caused by:
network failure seems to have happened
if a proxy or similar is necessary
net.git-fetch-with-cli
may help herehttps://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli
Caused by:
SSL error: received early EOF; class=Ssl (16); code=Eof (-20)
The command '/bin/sh -c cargo build --release' returned a non-zero code: 101
It is causing too much pain and delays, if it could be resolved please. As per above it says network failure but this is not true because the net is clearly working fine.
The text was updated successfully, but these errors were encountered: