rust-lang / docker-rust

The official Docker images for Rust
436 stars 88 forks source link

cannot finish updating crate.io index in rust container #102

Closed moba1 closed 2 years ago

moba1 commented 2 years ago

I wrote following Dockerfile & ran sudo docker build -t myapp:latest . in Fedora 34:

FROM rust:1 as builder
WORKDIR /usr/src/myapp
COPY . .
RUN cargo install --path .

FROM debian:buster-slim
COPY --from=builder /usr/local/cargo/bin/myapp /usr/local/bin/myapp
CMD ["myapp"]

but rust docker cannot build & stop updati crates.io index stage.

Sending build context to Docker daemon  923.1kB
Step 1/7 : FROM rust:1 as builder
 ---> b5b26606d1e7
Step 2/7 : WORKDIR /usr/src/myapp
 ---> Running in dd9a9a4fe90b
Removing intermediate container dd9a9a4fe90b
 ---> 0b488b6d8148
Step 3/7 : COPY . .
 ---> a4a6a7995a98
Step 4/7 : RUN cargo install --path .
 ---> Running in 356a8b9469e6
  Installing amethyst v0.1.0 (/usr/src/myapp)
    Updating crates.io index

In the local build, relevant process runs through without problems, and the build completes normally.

Environment

docker version

Client: Docker Engine - Community
 Version:           20.10.16
 API version:       1.41
 Go version:        go1.17.10
 Git commit:        aa7e414
 Built:             Thu May 12 09:18:03 2022
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.16
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.17.10
  Git commit:       f756502
  Built:            Thu May 12 09:15:47 2022
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.4
  GitCommit:        212e8b6fa2f44b9c21b2798135fc6fb7c53efc16
 runc:
  Version:          1.1.1
  GitCommit:        v1.1.1-0-g52de29d
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

OS

$ uname -a
Linux fedora 5.17.6-100.fc34.x86_64 #1 SMP PREEMPT Mon May 9 14:41:31 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/os-release
NAME=Fedora
VERSION="34 (Workstation Edition)"
ID=fedora
VERSION_ID=34
VERSION_CODENAME=""
PLATFORM_ID="platform:f34"
PRETTY_NAME="Fedora 34 (Workstation Edition)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:34"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f34/system-administrators-guide/"
SUPPORT_URL="https://fedoraproject.org/wiki/Communicating_and_getting_help"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=34
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=34
PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy"
VARIANT="Workstation Edition"
VARIANT_ID=workstation

Cargo.toml

[package]
name = "myapp"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
serde_yaml = "0.8"
clap = { version = "3.1.10", features = ["derive"] }
serde = { version = "1.0", features = ["derive"] }
reqwest = { version = "0.11", features = ["blocking", "json"] }
bytes = { version = "1", features = ["serde"] }
serde_json = "1.0"

[dev-dependencies]
tempfile = "3"
assert_cmd = "2"
moba1 commented 2 years ago

It was just going to take a little longer, so I'm closing this Issue.