我正在尝试在我的 Raspberry Pi 4(Pi OS 10(buster),armv7l)上构建一个 Dockerfile。
我正在使用docker buildx build .
which 开始正常但在获取包时遇到问题:
[build 3/5] RUN apk --no-cache add git build-base:
#6 0.673 fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/main/armv7/APKINDEX.tar.gz
#6 0.735 WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.14/main: temporary error (try again later)
#6 0.735 fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/community/armv7/APKINDEX.tar.gz
#6 0.737 WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.14/community: temporary error (try again later)
#6 0.737 ERROR: unable to select packages:
#6 0.739 build-base (no such package):
#6 0.739 required by: world[build-base]
#6 0.739 git (no such package):
#6 0.739 required by: world[git]
这感觉就像 apk 命令缺少连接,所以我想我可能缺少关于容器的互联网连接的一些东西(尽管前面的步骤工作正常......)
这是我正在尝试构建的 Dockerfile 的开始:
# Build container
ARG GOVERSION=1.17.3
FROM --platform=${BUILDPLATFORM} \
golang:$GOVERSION-alpine AS build
WORKDIR /src
RUN apk --no-cache add git build-base
有任何想法吗?