0

With the propagation of Apple M1 chips, we've encountered a problem. We are using Docker to build images to deploy our software, but we discovered that some images which are built from Dockerfiles like this:

FROM ubuntu:20.04 as base
...

are no longer working in our infrastructure. Those are images built on M1 machines, because, as it turns out, Ubuntu helpfully has a multiplatform image, and Docker chooses arm platform for M1 builds, while our deployment infrastructure, of course, remains on amd64.

We could go and edit every single Dockerfile to use

FROM --platform=linux/amd64 ubuntu:20.04 as base

and that fixes the problem, but this is very annoying, we have a lot of Dockerfiles. Is there some way to force Docker to always use amd64 platform for multiplatform images on the build side? One of the advantages of Docker has been - no matter where you build it, you get the predictable image. Now this assumption is broken, we'd like to restore it.

Frant
  • 5,382
  • 1
  • 16
  • 22
StasM
  • 10,593
  • 6
  • 56
  • 103
  • https://stackoverflow.com/a/66900911/9095551 – Beppe C Mar 23 '22 at 20:45
  • I'd recommend building multi platform images rather than forcing the arm users to run amd64 images. See buildx for how docker has simplified this. Also your servers should be running builds from controlled CI systems, not developer laptops. – BMitch Mar 24 '22 at 02:03
  • We don't need multi-platform images, why would we waste time and diskspace building them? – StasM Mar 24 '22 at 06:15
  • You seem to have multiple platforms in your organization. Otherwise, this question doesn't make sense. Why not support those other platforms? – BMitch Mar 24 '22 at 18:06

0 Answers0