Error: multiple platforms feature is currently not supported for docker driver

I’m getting the following error when I try to start this application up using docker-compose on a M1 Mac:

[+] Building 0.0s (0/0)
multiple platforms feature is currently not supported for docker driver. Please switch to a different driver (eg. "docker buildx create --use")

I’ve tried to follow the advice here: [Docker] Docker buildx support multiple architectures images | Cloud-oriented Life but no change.

My environment:

  • Docker Desktop: Engine: 20.10.14, Compose: v2.5.1
  • Mac M1 OS 12.2.1

When running the following:

To start and run application locally for development:

docker buildx build --platform linux/amd64 -f Dockerfile.dev .; docker-compose up

Docker Compose file:

version: "3.8"

services:
  web:
    platform: linux/amd64
    build:
      context: .
      dockerfile: Dockerfile.dev
    ports:
      - 8000:80
    volumes:
      - ./app:/code/app
    env_file:
      - ./app/.env

Dockerfile

FROM --platform=linux/amd64 ubuntu:20.04

RUN apt-get update && apt-get install -y zip libaio1 libaio-dev software-properties-common gcc && \
    add-apt-repository -y ppa:deadsnakes/ppa

RUN apt-get update && apt-get install -y python3.10 python3.10-distutils python3-pip python3.10-dev \
    python3-apt libgl1 libxrender-dev libsm6 libxext6 curl

RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10

# Install Oracle Instance DB Client
# Tips on installing - https://stackoverflow.com/questions/70011858/libclntsh-so-cannot-open-shared-object-file-using-docker-oracle-python
RUN mkdir -p /opt/oracle
WORKDIR /opt/oracle/
COPY packages/instantclient-basiclite-linux.x64-21.5.0.0.0dbru.zip /opt/oracle/
RUN unzip /opt/oracle/instantclient-basiclite-linux.x64-21.5.0.0.0dbru.zip -d /opt/oracle/
RUN echo "export LD_LIBRARY_PATH=/opt/oracle/instantclient_21_5" >> /etc/profile
RUN echo "export PATH=/opt/oracle/instantclient_21_5:$PATH" >> /etc/profile
RUN echo "export ORACLE_HOME=/opt/oracle/instantclient_21_5" >> /etc/profile
RUN cd /opt/oracle/instantclient_21_5 && cd /opt/oracle/instantclient_21_5 && export PATH=/opt/oracle/instantclient_21_5:$PATH && export ORACLE_HOME=/opt/oracle/instantclient_21_5
RUN rm /opt/oracle/instantclient-basiclite-linux.x64-21.5.0.0.0dbru.zip
ENV LD_LIBRARY_PATH /opt/oracle/instantclient_21_5:$LD_LIBRARY_PATH
WORKDIR /code

COPY ./requirements.txt /code/requirements.txt

RUN python3.10 -m pip install --no-cache-dir -r /code/requirements.txt
RUN python3.10 -m pip install watchgod

ENV PYTHONPATH "${PYTHONPATH}:/code/app"

COPY ./app /code/app

WORKDIR /code/app

CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "80", "--reload", "--reload-include", "*.yaml", "--reload-include", "*.j2", "--reload-include", "*.css"]

I could not reproduce your issue with Docker Compose v2.5.1 on Mac M1. It is true, docker itself does not support building for multiple platforms, but Docker Desktop can emulate platforms so it should have worked. I tried on Linux too (amd64) and I could not get the same error message.

Have you changed the builder configuration?

docker builder list

update:
The above command is wrong! I meant the following:

docker buildx ls
1 Like

I’m using Docker Desktop for Mac - 4.8.2 (79419)

When I run docker builder list - that subcommand is not found. I get the following.

> docker builder list

Usage:  docker builder COMMAND

Manage builds

Commands:
  build       Build an image from a Dockerfile
  prune       Remove build cache

Run 'docker builder COMMAND --help' for more information on a command.

Am I missing something?

Thanks!

Additional info that might be helpful to understand this

My Docker Engine v20.10.14 Configuration:

{
  "builder": {
    "gc": {
      "defaultKeepStorage": "20GB",
      "enabled": true
    }
  },
  "experimental": true,
  "features": {
    "buildkit": true
  }
}

docker buildx ls results

 > docker buildx ls
NAME/NODE       DRIVER/ENDPOINT             STATUS   PLATFORMS
modest_bohr     docker-container
  modest_bohr0  unix:///var/run/docker.sock inactive
mybuilder       docker-container
  mybuilder0    unix:///var/run/docker.sock stopped
desktop-linux   docker
  desktop-linux desktop-linux               running  linux/arm64, linux/amd64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6
default *       docker
  default       default                     running  linux/arm64, linux/amd64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6

No. Sorry, I meant docker buildx ls. I wrote my previous post too quickly.

It looks like your config is the same as mine including the versions, so I don’t know why it does not work for you.

The only difference I can see between your build and mine is that I could not try the whole Dockerfile since I don’t have the files from the host, but I doubt that could cause the error message. I only tried it with the first line where the platform is defined.

Check this link [Docker] Docker buildx support multiple architectures images | Cloud-oriented Life

2 Likes

So I nuked my entire installation (Docker for Desktop) and re-installed from scratch. Everything is now working fine (which makes me happy and sad at the same time :smile: )

Thanks everyone for your help and letting me know that it should work fine with no special configuration needed!

I’m running into this also with the same setup. I’m going to try a reinstall of Docker Desktop as well, but I wonder what’s causing it!

I to encountered this error. I uninstalled and reinstalled Docker Desktop, but the error remains.

Edit: So I had not followed the instructions closely enough. It does seem that it’s necessary to first follow the instructions at the link provided by edimoto.

When I said nuked my Docker installation above I should have been clearer, it meant: 1. uninstall 2. clean out all files left over 3. install 4. do a docker system reset just to make sure I didn’t have anything left over.

:smile:

Hello, stumbled upon this post googling and decided to make an account to reply what worked for us.

We came across the same error message about

[+] Building 0.0s (0/0)
multiple platforms feature is currently not supported [...]

What worked for my team, and I was commenting out the
platform: linux/amd64 portion of our docker-compose.yml file. Once I did that the container was able to re-build OK.

Hope that works!

Hey, no need to completely wipe your Docker Desktop!

I ran into the same/similar Issue today after Upgrading to Docker-Desktop 4.14.0 (91374) on M1.
Buildx starts complaining with this (no issues running the identical command the day before):

$ docker buildx build --no-cache --platform=linux/amd64,linux/arm64/v8,linux/arm/v7 -t <repo>:latest --push .
[+] Building 0.0s (0/0)
ERROR: multiple platforms feature is currently not supported for docker driver. Please switch to a different driver (eg. "docker buildx create --use")

I just recreated a new Buildx Instance using the docker-container driver, tell Docker to use it and it started working again :slight_smile:

$ docker buildx create --use desktop-linux
pedantic_goodall
$ docker buildx ls
NAME/NODE           DRIVER/ENDPOINT  STATUS  BUILDKIT PLATFORMS
pedantic_goodall *  docker-container
  pedantic_goodall0 desktop-linux    running v0.10.5  linux/arm64, linux/amd64, linux/amd64/v2, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6
default             docker
  default           default          running 20.10.21 linux/arm64, linux/amd64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6
desktop-linux       docker
  desktop-linux     desktop-linux    running 20.10.21 linux/arm64, linux/amd64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6
$ docker buildx build --no-cache --platform=linux/amd64,linux/arm64/v8,linux/arm/v7 -t <repo>/debugpod:latest --push .
[+] Building 57.5s (21/21) FINISHED
 => [internal] booting buildkit                                                                                                                                                                               2.6s
 => => pulling image moby/buildkit:buildx-stable-1                                                                                                                                                            2.1s
 => => creating container buildx_buildkit_pedantic_goodall0                                                                                                                                                   0.6s
 => [internal] load build definition from Dockerfile                                                                                                                                                          0.0s
 => => transferring dockerfile: 163B
[...]

Of course you can tweak a bit more using docker buildx create --use desktop-linux

2 Likes

docker buildx create --name multiarch --driver docker-container --use
This solved the issue for me

6 Likes

Hi, fortunately you may not need to nuke you setup. Simply docker buildx rm <name_of_builder>

should suffice. Then recreate with docker buildx create. Hope this helps someone