我有一个安装了Docker的Raspberry Pi 3 B +。我正在尝试获取最新的ARMv7版本的golang容器映像,如下所示。
当我在图像上运行docker pull
命令时,出现以下一般错误。
pi@trevorpi:~ $ docker pull arm32v7/golang:latest
Pulling repository docker.io/arm32v7/golang
Tag latest not found in repository docker.io/arm32v7/golang
这是我正在运行的Docker版本:
pi@trevorpi:~ $ docker version
Client:
Version: 1.8.3
API version: 1.20
Go version: go1.4.3
Git commit: f4bf5c7
Built:
OS/Arch: linux/arm
Server:
Version: 1.8.3
API version: 1.20
Go version: go1.4.3
Git commit: f4bf5c7
Built:
OS/Arch: linux/arm
这是uname -a
的输出,表明它是ARMv7:
Linux trevorpi 4.14.71-v7+ #1145 SMP Fri Sep 21 15:38:35 BST 2018 armv7l GNU/Linux
很显然,用于golang的x86 Docker映像不起作用,因为它与ARM不兼容。我可以提取图像,但由于处理器体系结构而无法运行:
pi@trevorpi:~ $ docker pull golang:latest
latest: Pulling from library/golang
836de16dcbe9: Already exists
490028bf21ec: Already exists
b9aece5a7acf: Already exists
e5bf67252042: Already exists
a221240e1da3: Already exists
efcf11bc5c78: Already exists
32d2d4bbdbd3: Already exists
599e9bccee8b: Already exists
b77bfa353366: Already exists
dc799d5ef217: Already exists
cb12e793d3e1: Already exists
c984412a4f12: Already exists
Digest: sha256:ce05c9f8151cc4ff3ce508509720597d103b630aa024bcfb012107149abfa361
Status: Image is up to date for golang:latest
pi@trevorpi:~ $ docker run --rm -it golang
WARNING: Your kernel does not support memory swappiness capabilities, memory swappiness discarded.
exec format error
Error response from daemon: Cannot start container 0c04cb7f7192f2059b029637bd6306c0a4ff83299e3a20df920b3ea56339ab7a: [8] System error: exec format error
问题:我手动验证了latest
标签是否有效。我需要怎么做才能拉出这张图片?
答案 0 :(得分:0)
也许您正在尝试下载不适用于您的系统(操作系统或体系结构)的映像。
$ docker manifest inspect -v arm32v7/golang:latest
[
{
"Ref": "docker.io/arm32v7/golang:latest@sha256:faf19ab885f9d0779bbbd615eee610c5aedfdd203ac5fceefbd5fc8afd73a2ac",
"Descriptor": {
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"digest": "sha256:faf19ab885f9d0779bbbd615eee610c5aedfdd203ac5fceefbd5fc8afd73a2ac",
"size": 1795,
"platform": {
"architecture": "arm",
"os": "linux",
"variant": "v7"
}
您确定您的树莓使用arm v7架构吗?不幸的是,我自己没有覆盆子,所以我无法重现此问题。 您是否尝试过使用除最新标签以外的其他标签?另外,您可以尝试自己构建此映像。 Golang repo
也许可以尝试使用golang的官方存储库:
docker pull golang:latest
它们还支持您的体系结构:
支持的体系结构:md64,arm32v6,arm32v7,arm64v8, i386,ppc64le,s390x,windows-amd6
也许这是连接/防火墙问题。您可以从其他存储库中提取信息吗?