Matthew van Boheemen
Matthew van Boheemen

Reputation: 1355

Azure DevOps build on Mac Agent - BuildKit is enabled but error message: the buildx component is missing or broken

We have a self-hosted Azure DevOps build agent that runs on a Mac computer. We installed Docker Desktop on the machine and in our pipeline YAML we build docker images using the "docker build" command.

When the "docker build" command runs it produces the error:

ERROR: BuildKit is enabled but the buildx component is missing or broken.
       Install the buildx component to build images with BuildKit:
       https://docs.docker.com/go/buildx/

Running the exact same command manually through a terminal on the same build agent works.

We have changed to not using BuildX by setting DOCKER_BUILDKIT: 0 and this works successfully. However, this legacy build is going to be deprecated and this is not a good long term solution.

Why would this be happening and how can we fix it?

Upvotes: 1

Views: 523

Answers (1)

Matthew van Boheemen
Matthew van Boheemen

Reputation: 1355

This appears to be because I was using the @Docker task to login to an Azure Container Registry. This then screwed with subsequent scripts in the build when they ran Docker commands. I'm not sure what was happening but after I removed the @Docker task and logged into the ACR via a script task then the problem resolved itself.

Upvotes: 0

Related Questions