有人试着用dockerhub上的说明建立一个rust图像吗?https://hub.docker.com/_/rust
FROM rust:1.40 as builder
WORKDIR /usr/src/myapp
COPY . .
RUN cargo install --path .
FROM debian:buster-slim
RUN apt-get update && apt-get install -y extra-runtime-dependencies && rm -rf /var/lib/apt/lists/*
COPY --from=builder /usr/local/cargo/bin/myapp /usr/local/bin/myapp
CMD ["myapp"]
当我试图使用Docker build -t myapp构建它时,我得到了一个错误:
=> CACHED [stage-1 1/3] FROM docker.io/library/debian:buster-slim@sha256:5dbce817ee72802025a38a388237b0ea576aa16 0.0s
=> ERROR [stage-1 2/3] RUN apt-get update && apt-get install -y extra-runtime-dependencies && rm -rf /var/lib/ap 5.4s
------
> [stage-1 2/3] RUN apt-get update && apt-get install -y extra-runtime-dependencies && rm -rf /var/lib/apt/lists/*:
#6 0.617 Get:1 http://deb.debian.org/debian buster InRelease [122 kB]
#6 0.698 Get:2 http://deb.debian.org/debian-security buster/updates InRelease [34.8 kB]
#6 0.731 Get:3 http://deb.debian.org/debian buster-updates InRelease [56.6 kB]
#6 0.875 Get:4 http://deb.debian.org/debian buster/main amd64 Packages [7909 kB]
#6 1.700 Get:5 http://deb.debian.org/debian-security buster/updates/main amd64 Packages [397 kB]
#6 1.734 Get:6 http://deb.debian.org/debian buster-updates/main amd64 Packages [8788 B]
#6 2.708 Fetched 8529 kB in 2s (3802 kB/s)
#6 2.708 Reading package lists...
#6 3.432 Reading package lists...
#6 4.230 Building dependency tree...
#6 4.443 Reading state information...
#6 4.571 E: Unable to locate package extra-runtime-dependencies
------
executor failed running [/bin/sh -c apt-get update && apt-get install -y extra-runtime-dependencies && rm -rf /var/lib/apt/lists/*]: exit code: 100
1条答案
按热度按时间k97glaaz1#
Rust文档需要对此进行澄清,但
extra-runtime-dependencies
是占位符。解释为here