docker Buildx "ERROR: BuildKit is enabled but the buildx component is missing or broken" error
Asked Answered
G

7

14

When I try to do a Docker Build using Docker as usual, I get the error message in the image and cannot Build. What should I do in this case? By the way, Docker's version is 23.0.1. enter image description here enter image description here enter image description here

When I uninstall docker buildx and then Build, I get other warning errors and the Build itself works, but parallel processing cannot be performed. My ideal would be to use Buildx to do a parallel Build.

Griffen answered 15/3, 2023 at 0:28 Comment(0)
L
16

I also had a similar issue with version 23.0.2. For me it was missing buildx package. Following command solved the issue.

apt-get install docker-buildx-plugin

Message and docs of docker on linux are a bit vague unfortunately. I found out the missing package while I was planning to install docker from scratch.

Lynettalynette answered 30/3, 2023 at 12:20 Comment(0)
F
19

Did you maybe use Docker Desktop on Windows, uninstall it, and then tried to install Docker directly on WSL?

In that case you may have an issue that in /usr/local/lib/docker/cli-plugins/ you don't have actual files, but broken links to WSL installation. This happened to me.

To verify check output from: ls -la /usr/local/lib/docker/cli-plugins/

In my case, I rm these broken links, then rerun Docker installation on WSL and it solved the problem.

Felicitation answered 21/3, 2023 at 19:33 Comment(2)
In my case it was sufficient to just remove these old/broken symlinks. I did not have to reinstall docker. I did run the command sudo apt-get install --reinstall docker-buildx-plugin docker-compose-plugin docker-scan-plugin though, but this command did not restore any symlinks/files in that directory. – Billie
Ironically, the --reinstall flag was what did the trick for me. – Yuletide
L
16

I also had a similar issue with version 23.0.2. For me it was missing buildx package. Following command solved the issue.

apt-get install docker-buildx-plugin

Message and docs of docker on linux are a bit vague unfortunately. I found out the missing package while I was planning to install docker from scratch.

Lynettalynette answered 30/3, 2023 at 12:20 Comment(0)
D
2

For me (Ubuntu 22.04 LTS),

apt install docker-buildx-plugin

was not working ("E: Unable to locate package docker-buildx-plugin"), but the fix was

apt install docker-buildx
Drubbing answered 11/7 at 7:53 Comment(0)
R
1

Installation command :

sudo apt-get install docker-buildx-plugin

new command to build is :

docker buildx build -t dotnetservice:latest .
Radiotelephone answered 14/6 at 10:12 Comment(0)
L
0

A more complete solution:

  1. Find the name of the missing system package using substring search with apt cache:
$ apt cache buildx
docker-buildx-plugin - Docker Buildx cli plugin.
  1. Update packages lists and install the required package (using apt - newer version of apt-get - and standard user with sudo, rather than root):
$ sudo apt update && sudo apt install -y docker-buildx-plugin
Lapsus answered 23/7, 2023 at 10:15 Comment(1)
E: Unable to locate package docker-buildx-plugin – Merle
W
0

I had docker desktop for windows installed and wsl2 and ubuntu on windows. When i uninstalled docker desktop this error started appearing. Reinstalling docker desktop made things work again.

Uninstalling docker desktop removes or changes some files it seems that breaks docker in wsl.

Wideeyed answered 13/3 at 9:28 Comment(0)
S
0

I was trying to do some Docker stuff inside my Windows WSL2 instance but completely forgot to launch Docker Desktop on Windows πŸ’€

After starting Docker Desktop, everything worked fine inside my WSL2 instance.

I'm the reason IT support always asks if the router is plugged in.

Simpatico answered 10/7 at 15:46 Comment(2)
Hi hihihi, Thanks for your response! While your experience with Docker Desktop is valid, it might not address the specific "BuildKit is enabled but the buildx component is missing or broken" error. For future answers, consider: -Addressing the specific error directly. -Providing detailed troubleshooting steps. -Including relevant commands or configurations. For this question, could you explore potential issues with Docker Buildx configuration or suggest ways to verify its installation? Your detailed guidance will greatly benefit the community. Thanks again for your help! – Austere
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center. – Realist

© 2022 - 2024 β€” McMap. All rights reserved.