0

I'm trying here, after having posted the following on the Docker Forum.

I’ve tried the buildx command explained in the documentation (from my Intel-based Mac):

# This normally works with build, without buildx
git clone https://github.com/Rothamsted/knetminer
cd knetminer
# buildx is the new thing I'm trying, to have multi-arch support
docker buildx build --platform linux/amd64,linux/arm64 -t knetminer/knetminer -f docker/Dockerfile --push .

However, when I try the published image on an ARM64, I still get the usual: standard_init_linux.go:211: exec user process caused “exec format error”

Is buildx enough to obtain multiple-architecture images? Or do I need more (eg, Linux images that actually support ARM)?

My image is based on another one, which is based on a Tomcat +Linux image. Do I need to re-run buildx on all the parents?

For those interested in details, this is about building the image for our own application from its codebase, documentation here.

Thanks in advance.

zakmck
  • 2,715
  • 1
  • 37
  • 53
  • Does the parent image run on arm64, and has it been built for every platform? Please include a [mcve] including a Dockerfile we can build to reproduce your error. – BMitch Apr 13 '21 at 23:20
  • Probably the upper images don't have an ARM flavour. I'm realising I need that and I'll try to work it out. The command above should be enough to reproduce my case, since all the involved images are on dockerhub and auto-downloaded from there. – zakmck Apr 14 '21 at 11:58
  • The command above is not enough to reproduce your case: `error: could not find docker: stat docker: no such file or directory` – BMitch Apr 14 '21 at 12:35
  • OK, I've added the bits you need, but actually it would apply to any kind of image one wants to build. In fact, I've already got a good answer below. – zakmck Apr 14 '21 at 15:10

1 Answers1

2
standard_init_linux.go:211: exec user process caused “exec format error”

Does happen, when you try to run a image for another architecture on your devices.

Your base image must support the choosen architecture too. So you must build the parent by yourself for your architecture, if it does not support your architecture.

In dockerhub you can see supported architectures under tags. Alternative you can use the docker image inspect command.