Minikube在M1硬件上部署Linux/AMD64图像

发布于 2025-01-31 02:46:26 字数 456 浏览 3 评论 0原文

我知道可以使用- Platform linux/amd64 flag在docker run上使用- platform linux/amd64 flag在Apple的M1处理器上本地运行。

但是,如何在同一M1硬件上运行的本地Minikube群集上部署相同的图像?

尝试时的输出是:

Failed to pull image "registry/image:tag": 
rpc error: code = Unknown desc = no matching manifest for linux/arm64/v8 in the manifest list entries

如何告诉Minikube在部署时会导致与- Platform Linux/AMD64标志相同的效果?

I know it's possible to run locally on Apple's M1 processor an amd64 image by using the --platform linux/amd64 flag on docker run.

But how do I deploy that same image on a local Minikube cluster, running on this same M1 hardware?

Output when trying is:

Failed to pull image "registry/image:tag": 
rpc error: code = Unknown desc = no matching manifest for linux/arm64/v8 in the manifest list entries

How do I tell Minikube to cause the same effect as --platform linux/amd64 flag on its deployment?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

人生百味 2025-02-07 02:46:26

我遇到了同一问题。我的解决方案是:

  1. 按照您描述的Docker Pull注册表/图像:TAG - Platform Linux/AMD64
  2. ImagePullPolicy 设置为从不
spec:
  containers:
  - name: container-name
    image: registry/image:tag
    imagePullPolicy: Never  # or IfNotPresent

将您的容器规格的MinikubeImagePullPolicy设置为始终每当使用最新标记的映像时,请手动将其设置为从不迫使节点使用您已经下载的图像。

I ran into the same issue. My solution was to:

  1. Pull the image locally as you described with docker pull registry/image:tag --platform linux/amd64.
  2. Set your containers spec's imagePullPolicy to Never, which makes it get the image locally rather than pulling it from the registry:
spec:
  containers:
  - name: container-name
    image: registry/image:tag
    imagePullPolicy: Never  # or IfNotPresent

Both kind and minikube set the imagePullPolicy to Always whenever an image with the latest tag is used, so manually setting it to Never forces the node to use your already downloaded image.

世俗缘 2025-02-07 02:46:26

不确定使用Docker桌面,但是如果您使用Colima,则可以为Lima VM选择拱门。

一旦将Docker引擎运行在M1上的ARCH X86_64的VM中,它将拉动AMD64图像。

使用colima start -ark x86_64在启动时使用该拱门。

然后,您可以在Colima上运行Minikube,也可以使用Colima内置的Kubernetes群集。

注意:您可能需要使用 - -runtime容器来完成此工作。我有使用默认运行时(Docker)的问题

Not sure with Docker Desktop, but if you use Colima, you can select the arch for the lima VM.

Once you have a docker engine running in a VM with arch x86_64 on the M1, it will pull amd64 images.

use colima start --arch x86_64 on startup to use that arch.

You can then run MiniKube on Colima, or just use the Colima built-in kubernetes cluster.

Note: You may need to use the --runtime containerd to make this work. I have had issues with using the default runtime (docker)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文