docker build says BuildKit is enabled but the buildx component is missing or broken
ERROR: BuildKit is enabled but the buildx component is missing or broken.Short answer
docker build is backed by the buildx plugin. When the plugin is not installed, or the file exists but cannot run, Docker prints this error. Install the docker-buildx-plugin package from Docker's apt repository, or download the binary into a cli-plugins folder and make it executable.
Fix it fast
1Find out which cause you have
Ask Docker whether it can see the buildx plugin.
docker buildx version docker version2Match what you see, then jump to its fix
What does the error look like?
ERROR: BuildKit is enabled but the buildx component is missing or broken.
Cause 1 of 2
The docker-buildx-plugin package is not installed
1Check
Docker's Ubuntu install command lists docker-buildx-plugin next to docker-ce and docker-ce-cli. If that package was left out of the install, the plugin is absent.
apt list --installed 2>/dev/null | grep -i docker2Fix
Install the plugin from Docker's apt repository.
sudo apt install docker-buildx-plugin3Verify
buildx prints a version.
docker buildx versionConfirmed by docs.docker.com
Cause 2 of 2
A manually downloaded binary is in the wrong place or not executable
1Check
The binary must be named docker-buildx and sit in a cli-plugins folder. On Linux and macOS that is $HOME/.docker/cli-plugins for one user. System-wide folders include /usr/local/lib/docker/cli-plugins and /usr/libexec/docker/cli-plugins.
ls -l ~/.docker/cli-plugins/2Fix
Move or rename the file to docker-buildx in that folder and make it executable.
mkdir -p ~/.docker/cli-plugins
mv ./buildx-v0.0.0.linux-amd64 ~/.docker/cli-plugins/docker-buildx # your downloaded file name
chmod +x ~/.docker/cli-plugins/docker-buildx3Verify
docker finds the plugin.
docker buildx versionConfirmed by docs.docker.com
How do I stop it coming back?
- Install Docker from Docker's own apt repository with the full package list, so buildx and compose arrive with the engine.
- Remove conflicting distro packages before installing Docker Engine.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
Related fixes
Servers
Apache logs SIGWINCH and exits on its own
the httpd container stops although nothing crashed
SIGWINCH is Apache's graceful-stop signal.
2 causes, each with a fixServers
sam local fails: Running AWS SAM projects locally requires Docker
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
sam local start-api and sam local invoke run your function inside a Docker container, so SAM stops if it cannot talk to Docker.
3 causes, each with a fixServers
dnf fails to download repo metadata in a CentOS 8 Docker build
The same Dockerfile built fine before 2022
CentOS Linux 8 reached end of life on 31 December 2021 and its content left the mirrors.
2 causes, each with a fixServers
pip install confluent-kafka fails because librdkafka/rdkafka.h is missing
pip stops while building confluent-kafka from source
The error means pip is compiling confluent-kafka from source, and the compiler cannot find the librdkafka C headers.
3 causes, each with a fixServers
Cypress says the npm package is installed but the binary is missing
Cypress binary is missing after npm install in CI or in a Docker build
The npm package is only a launcher.
3 causes, each with a fixServers
A dev container port does not open in the browser when Docker runs on a remote host
If your application only accepts calls from localhost, it will reject connections from published ports
Three things usually break it: the app listens only on localhost inside the container, so published ports are rejected; you open the container port instead of the mapped localhost port VS Code shows; or you changed appPort or a Compose ports list and did not rebuild.
3 causes, each with a fix