我正在尝试从
Alpine
构建 docker 映像并添加特定版本的 rust
,但我收到此错误并且构建失败。
#7 [3/5] RUN apk add rust=1.72.1-r0
#7 4.203 fetch https://dl-cdn.alpinelinux.org/alpine/v3.17/main/armv7/APKINDEX.tar.gz
#7 5.012 fetch https://dl-cdn.alpinelinux.org/alpine/v3.17/community/armv7/APKINDEX.tar.gz
#7 6.228 ERROR: unable to select packages:
#7 6.405 rust-1.64.0-r2:
#7 6.405 breaks: world[rust=1.72.1-r0]
#7 ERROR: process "/bin/sh -c apk add rust=1.72.1-r0" did not complete successfully: exit code: 1
这是我的
Dockerfile
。
ARG version=3.9
ARG tag=${version}-alpine3.17
FROM python:${tag} as builder
WORKDIR /app
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
RUN apk add rust=1.72.1-r0
RUN rustc -V
我正在构建
Linux raspberrypi 6.1.21-v7+ #1642 SMP Mon Apr 3 17:20:52 BST 2023 armv7l GNU/Linux
如果你检查相关镜像所使用的 Alpine Linux 版本,你会发现它是
3.17.5
:
docker run --rm -it python:3.9-alpine3.17 cat /etc/os-release
>>> NAME="Alpine Linux"
>>> ID=alpine
>>> VERSION_ID=3.17.5
>>> PRETTY_NAME="Alpine Linux v3.17"
>>> HOME_URL="https://alpinelinux.org/"
>>> BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues"
1.64.0-r2
。