docker: Error response form daemon:
image with reference qwerty22/kube-kompose:pok-0 was found
but does not match the specified platform:
wanted windows/amd64, actual : linux/arm64.
这对我来说是新的。我认为 Docker/标准镜像是“通用的”。但现在看来您需要为每个平台构建一个映像 - 才能在其上运行?
示例图像是来自 [https://github.com/kubernetes/kompose] 的 kubernetes-kompose
编辑:我试图在 Win 10 和 Docker 桌面上运行该映像。
所以问题是:我可以使用 Mac 构建 Docker 映像,将映像推送到 Docker Hub,将映像拉取到 Win 10,然后在那里运行吗?
我似乎没有成功。
构建和运行的操作系统架构必须兼容。
您应该在 Docker 桌面上打开 Linux 容器。为此,右键单击 Docker 桌面图标,然后从菜单中选择
Switch to Linux Containers
。
有关更多详细信息,请查看本指南。
另一种方法是在 Mac M1 上为
amd64
构建映像,如下所示:
docker buildx build --platform linux/amd64 --push -t <registry>/<project-id>/<image>
因为使用 Apple Silicon 构建的 docker 映像是基于 ARM 的架构,这可能会在将映像部署到基于 Linux 或 Windows 的
amd64
环境时产生问题。