Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Minikube to deploy linux/amd64 images on M1 hardware

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?

like image 683
alpha_hotel Avatar asked Dec 09 '25 21:12

alpha_hotel


2 Answers

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.

like image 121
Micaiah Reid Avatar answered Dec 11 '25 10:12

Micaiah Reid


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)

like image 21
MrE Avatar answered Dec 11 '25 11:12

MrE