Current version of Docker Desktop for MacOS Silicon claims BuildKit is not installed

I keep getting BuildKit errors on the latest version of Docker Desktop for Mac Silicon (M2):

the --mount option requires BuildKit. Refer to https://docs.docker.com/go/buildkit/ to learn how to build images with BuildKit enabled

The Docker documentation claims that BuildKit is automatically installed on the latest Docker Desktop so this does not make sense. I have, as best I can tell, completely uninstalled and re-installed docker and docker desktop but the problem remains.

If I use the DOCKER_BUILDKIT=1 everything runs, but I shouldn’t need to run this, should I? Everything I can find on this topic is people trying to do the opposite (prevent buildkit being used by default). Adding daemon configuration to use "buildkit": true doesn’t seem to have any effect either, but again this should not be required.

Any suggestions would be gratefully received. If seems like something is bugged in my configuration, but I haven’t knowingly changed anything and this just started happening a few weeks ago.

Can you share the exact version number just to see that we are talking about the same version? It also helps future readers understanding what version this issue about.

You are right that poeple were usually doing the opposite to disable buildkit, so one guess is that it was done on your machine as well somehow. Maybe added to bashrc or to whatever shell you are using. I haven’t seen it with the buildkit variable yet, but people did it with other Docker-related variables like DOCKER_HOST.

This wordked for me on my Mac with Docker Desktop 4.60

FROM ubuntu:24.04

RUN --mount=type=bind,source=.,target=/app ls -lahs /app

Thanks @rimelek

I’ve checked all the zsh config files and there is nothing docker-related there. I don’t have a bashrc file since I’m using zsh, but that was a good suggestion, it does feel like maybe something is overriding the default.

Sorry, I should have provided version info earier.

Docker Desktop:
Version: 4.59.1 (217750)
Engine: 29.2.0
Compose: v5.0.2

Docker version 29.2.0, build 0b9d198

docker info gives:

Client:
 Version:    29.2.0
 Context:    desktop-linux
 Debug Mode: false
 Plugins:
  ai: Docker AI Agent - Ask Gordon (Docker Inc.)
    Version:  v1.17.2
    Path:     /Users/hugh/.docker/cli-plugins/docker-ai
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.31.1-desktop.1
    Path:     /Users/hugh/.docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v5.0.2
    Path:     /Users/hugh/.docker/cli-plugins/docker-compose
  debug: Get a shell into any image or container (Docker Inc.)
    Version:  0.0.47
    Path:     /Users/hugh/.docker/cli-plugins/docker-debug
  desktop: Docker Desktop commands (Docker Inc.)
    Version:  v0.2.0
    Path:     /Users/hugh/.docker/cli-plugins/docker-desktop
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.31
    Path:     /Users/hugh/.docker/cli-plugins/docker-extension
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v1.4.0
    Path:     /Users/hugh/.docker/cli-plugins/docker-init
  mcp: Docker MCP Plugin (Docker Inc.)
    Version:  v0.37.0
    Path:     /Users/hugh/.docker/cli-plugins/docker-mcp
  model: Docker Model Runner (Docker Inc.)
    Version:  v1.0.8
    Path:     /Users/hugh/.docker/cli-plugins/docker-model
  offload: Docker Offload (Docker Inc.)
    Version:  v0.5.41
    Path:     /Users/hugh/.docker/cli-plugins/docker-offload
  pass: Docker Pass Secrets Manager Plugin (beta) (Docker Inc.)
    Version:  v0.0.24
    Path:     /Users/hugh/.docker/cli-plugins/docker-pass
  sandbox: Docker Sandbox (Docker Inc.)
    Version:  v0.11.0
    Path:     /Users/hugh/.docker/cli-plugins/docker-sandbox
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     /Users/hugh/.docker/cli-plugins/docker-sbom
  scout: Docker Scout (Docker Inc.)
    Version:  v1.19.0
    Path:     /Users/hugh/.docker/cli-plugins/docker-scout

Server:
 Containers: 20
  Running: 6
  Paused: 0
  Stopped: 14
 Images: 18
 Server Version: 29.2.0
 Storage Driver: overlayfs
  driver-type: io.containerd.snapshotter.v1
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 CDI spec directories:
  /etc/cdi
  /var/run/cdi
 Discovered Devices:
  cdi: docker.com/gpu=webgpu
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: dea7da592f5d1d2b7755e3a161be07f43fad8f75
 runc version: v1.3.4-0-gd6d73eb8
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.12.67-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: aarch64
 CPUs: 10
 Total Memory: 7.653GiB
 Name: docker-desktop
 ID: 5c53e8de-4296-4716-b237-f9ac1c37ea74
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Labels:
  com.docker.desktop.address=unix:///Users/hugh/Library/Containers/com.docker.docker/Data/docker-cli.sock
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5555
  ::1/128
  127.0.0.0/8
 Live Restore Enabled: false
 Firewall Backend: iptables

Current Docker versions use buildx as default builder. Buildx is based on buildkit, so I don’t know what else could override the builder than an env variable somewhere, but you can try two more things I can think of.

  • Try running docker buildx build instead ofdocker build.
  • I don’t actually know if you could disable buildkit for individual builders, but you can inspect the current builder by running: docker builder inspect. IT should show the buildkit version like on my machine: BuildKit version: v0.27.0

Ah, ok @rimelek thanks for your help with this. It looks like your first suggestion was on the money. If I run env I can see that somewhere I have two variables set:

DOCKER_BUILDKIT=0
COMPOSE_DOCKER_CLI_BUILD=0

Now I just need to figure out …where. Thanks again!