linux “未能解决:在ARM mac上创建amd64 docker镜像时,“不支持操作系统”

qyyhg6bp  于 2023-06-21  发布在  Linux
关注(0)|答案(1)|浏览(154)

我的印象是M1/M2 Mac上的Docker(使用aarch 64/ARM架构)支持构建amd 64容器。而且看起来确实把它们造得很好。
但是在构建容器之后,它在最后一步失败了:
docker buildx build --platform x86_64 -t dark

Building docker image
[+] Building 1.6s (68/68) FINISHED
 => [internal] load build definition from Dockerfile                               0.0s
 => => transferring dockerfile: 32B                                                0.0s
 => [internal] load .dockerignore                                                  0.0s
 => => transferring context: 34B                                                   0.0s
 => [internal] load metadata for docker.io/library/ubuntu:20.04@sha256:7cc0576c7c  1.4s
 => [ 1/64] FROM docker.io/library/ubuntu:20.04@sha256:7cc0576c7c0ec2384de5cbf245  0.0s
 => => resolve docker.io/library/ubuntu:20.04@sha256:7cc0576c7c0ec2384de5cbf245f4  0.0s
 => CACHED [ 2/64] RUN DEBIAN_FRONTEND=noninteractive     apt update --allow-rele  0.0s
-- ignore 62 steps here for brevity --
 => CACHED [64/64] RUN mkdir -p       /home/dark/.vscode-server/extensions         0.0s
 => ERROR exporting to image                                                       0.0s
 => => exporting layers                                                            0.0s
 => => writing image sha256:4c0b1a1acd5c0c3c87ec9e2aa2c34cff9b6b698b83bfb6d0d10ff  0.0s
------
 > exporting to image:
------
error: failed to solve: operating system is not supported

我该怎么解决这个问题?

版本号

uname -a
达尔文cotedor.lan 21.5.0 Darwin内核版本21.5.0:PDT 2022年4月26日星期二21:08:29; root:xnu-8020.121.3~4/RELEASE_ARM64_T8101 arm64 arm达尔文
docker --version
Docker版本20.10.14,build a224086
Docker for Mac:
4.8.2(79419),发动机:20.10.14
操作系统:macOS 12.4 Monterey

0pizxfdo

0pizxfdo1#

在Docker设置中的“开发中的功能”下启用“在Apple Silicon上使用Rosetta for x86/amd 64仿真”对我来说很有效。

相关问题