Building ARM64 docker image with a base image that only supports AMD64

Viewed 329

I have a MacBook Pro with M1 and I am trying to test if I can build an ARM64 image with a base image that only supports AMD64 by specifying --platform linux/arm64.

I tested with rocker/r-ver:4.0.4(only supports AMD64) and was able to build with this command below without any error

docker build --platform linux/arm64 -t r-ver-arm64:test

my dockerfile is just FROM rocker/r-ver:4.0.4

But when I tested with python:3.3-alpine3.4(supports AMD64 only) with command

docker build --platform linux/arm64 -t python-arm64:test

Dockerfile is FROM python:3.3-alpine3.4

I've got an error message, saying no match for platform in manifest

[+] Building 1.3s (4/4) FINISHED                                                                                                                                  
 => [internal] load build definition from Dockerfile                                                                                                         0.0s
 => => transferring dockerfile: 207B                                                                                                                         0.0s
 => [internal] load .dockerignore                                                                                                                            0.0s
 => => transferring context: 34B                                                                                                                             0.0s
 => ERROR [internal] load metadata for docker.io/library/python:3.3-alpine3.4                                                                                1.2s
 => [auth] library/python:pull token for registry-1.docker.io                                                                                                0.0s
------
 > [internal] load metadata for docker.io/library/python:3.3-alpine3.4:
------
error: failed to solve: failed to solve with frontend dockerfile.v0: failed to create LLB definition: no match for platform in manifest sha256:32b65b0dd11df5fb4dcf1e0f6bb05007b6b84270959ab27b618b513321ef6d6a: not found

I don't understand why it works for r-ver:4.0.4 base image, but doesn't for python:3.3-alpine3.4

Could someone help me with it?

0 Answers
Related