pf12345678910
pf12345678910

Reputation: 451

docker - BuildKit is enabled but the buildx component is missing or broken

This is what I get using the mount option

RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update && \
apt-get install -y --no-install-recommends python3 g++ build-essential && \
rm -rf /var/lib/apt/lists/*

the error is

##[error]DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
##[error]            Install the buildx component to build images with BuildKit:
##[error]            https://docs.docker.com/go/buildx/
##[error]the --mount option requires BuildKit. Refer to https://docs.docker.com/go/buildkit/ to learn how to build images with BuildKit enabled
##[error]The process '/usr/bin/docker' failed with exit code 1

I tried

export DOCKER_BUILDKIT=1 
docker build .

or

DOCKER_BUILDKIT=1 docker build .

or with azure pipeline,

variables:
  DOCKER_BUILDKIT: 1

I get

##[error]ERROR: BuildKit is enabled but the buildx component is missing or broken.
##[error]       Install the buildx component to build images with BuildKit:
##[error]       https://docs.docker.com/go/buildx/
##[error]The process '/usr/bin/docker' failed with exit code 1

Any help appreciated

[edit]

docker 24.0.5 ubuntu 22.04

I am following this workflow

https://backstage.io/docs/deployment/docker

Upvotes: 0

Views: 288

Answers (1)

pf12345678910
pf12345678910

Reputation: 451

as simple as this :

apt install docker-buildx-plugin

Upvotes: 0

Related Questions