GoogleContainerTools / kaniko

Build Container Images In Kubernetes
Apache License 2.0
14.84k stars 1.44k forks source link

Doesn't keep the image source platform #1525

Open gizmo3845 opened 3 years ago

gizmo3845 commented 3 years ago

Actual behavior

When processing a Dockerfile using an ARM platform, it produces a AMD64 instead keeping ARM as docker build is doing.

Expected behavior If the Dockerfile is only copy files or less the result image should keep the same platform as the source.

To Reproduce

Dockerfile:

FROM mcr.microsoft.com/dotnet/aspnet:5.0-buster-slim-arm32v7 ENTRYPOINT [ "/bin/bash" ]

If I do on my amd64 machine:

docker build -t myimage:1.0 -f Dockerfile .

It generates an ARM platform image.

Using kaniko ( gcr.io/kaniko-project/executor:latest )

/kaniko/executor --context $repoRoot --dockerfile Dockerfile --no-push --destination myimage:1.0 --tarPath myimage.tar

It produces and AMD64 image.

Why it has not the same behavior as docker build ?

ankitm123 commented 3 years ago

That kaniko image gcr.io/kaniko-project/executor:latest is an amd64 image, may be try with gcr.io/kaniko-project/executor:arm64 I dont see an arm32 image for kaniko though.