Questions tagged [docker-buildkit]

142 questions
115
votes
3 answers

When using BuildKit with Docker, how do I see the output of RUN commands?

When building Docker images with DOCKER_BUILDKIT=1, there is a very cool progress indicator but no command output. How do I see the command output to debug my build?
joeforker
  • 40,459
  • 37
  • 151
  • 246
72
votes
3 answers

How do you enable BuildKit with docker-compose?

I tried export DOCKER_BUILDKIT=1 before a docker-compose build command and I did not see the expected BuildKit output. What did I miss?
Archimedes Trajano
  • 35,625
  • 19
  • 175
  • 265
31
votes
5 answers

Enable "progress plain" in docker-compose file

When I run a build using docker-compose build --progress plain, it shows more useful information during the build than the default BuildKit output. Is there a way to embed the plain progress option into the docker-compose.yml file itself so I can…
Allan Jackson
  • 471
  • 1
  • 4
  • 10
23
votes
2 answers

Using Docker Buildkit on Google Cloud Build

I'm trying to use BuildKit with Docker on Google Cloud Build so that I can eventually use the --secret flag. I'm using Build Enhancements for Docker as a reference. It works on my laptop when I use the following command: DOCKER_BUILDKIT=1 docker…
Mark
  • 251
  • 2
  • 6
21
votes
1 answer

How do I attach to intermediate docker container when building with buildkit

I recently heard about Buildkit and have been trying to use it with Docker. I'm using DOCKER_BUILDKIT=1 docker build . -t experimental to build my Dockerfile. My Dockerfile doesn't build properly because of some missing dependant packages. What I…
Jinu
  • 536
  • 1
  • 4
  • 12
17
votes
4 answers

Tag multiple targets during one docker build

I have a Dockerfile with multiple targets. For example: FROM x as frontend ... FROM y as backend ... FROM z as runtime ... COPY --from=frontend ... COPY --from=backend ... In order to build and tag the final image, I use: docker build -t…
fbjorn
  • 722
  • 12
  • 27
17
votes
3 answers

docker buildkit mount ssh when using remote agent forwarding

I use the --ssh docker buildkit feature and it works fine locally. I want to build Docker at a remote server and for that I use the -A flag to forward my local github key, like: ssh -i "server.pem" -A @ Then in server terminal I…
user3599803
  • 6,435
  • 17
  • 69
  • 130
15
votes
2 answers

Docker BuildX image not showing in docker image ls

I am currently trying to build a multi-platform image (x86_64, arm64, armv7, armv6) using BuildKit/BuildX, and it seems to build successfully, but I can't seem to find where the image is located. It doesn't show up changed from my previous build for…
Revvz
  • 455
  • 1
  • 6
  • 14
15
votes
1 answer

Docker run --mount make all files available in a different folder during RUN

I want to make a folder on my host machine available during a RUN statement. That is, similar to the effect of a container run with -v: docker run -v /path/on/host:/path/in/container mycontainer:tag In the container this gives me /path/in/container…
robertdj
  • 909
  • 1
  • 5
  • 10
14
votes
1 answer

What is the difference between Kaniko and BuildKit/Buildx?

From what I understand: They are both tools to build container images The build itself runs in a container The build can happen on a remote node, for example in a Kubernetes cluster (Kaniko, BuildKit) They both offer advanced features such as layer…
Yacine Nouri
  • 184
  • 1
  • 10
13
votes
1 answer

How do I reuse the cache from a `RUN --mount=type=cache` docker build?

I'm using the new experimental docker buildkit syntax to do a multistage build, as so: Dockerfile: RUN --mount=type=cache,target=/home/build/.build-cache,gid=1000,uid=1001 ./build bash: DOCKER_BUILDKIT=1 docker build . Works great locally. On CI I…
Robert Elliot
  • 1,372
  • 13
  • 20
12
votes
3 answers

Tagging multi-platform images in ECR creates untagged manifests

I've started using docker buildx to tag and push mutli-platform images to ECR. However, ECR appears to apply the tag to the parent manifest, and leaves each related manifest as untagged. ECR does appear to prevent deletion of the child manifests,…
11
votes
1 answer

Is it possible to push docker images for different architectures separately?

From what I know docker buildx build --push will overwrite existing image architectures with the one you specified in --platform parameter. As I understand you have to build and push for all architectures at the same time when using buildx. However,…
chingis
  • 1,514
  • 2
  • 19
  • 38
11
votes
2 answers

Docker Buildx Cannot Pull From Local for Inherited Image

I have 2 Dockerfiles on my Host Machine ( Ubuntu 20.04 ). I am running docker-ce version Docker version 19.03.12, build 48a66213fe with Experimental Features enabled. I am able to build each of them with "docker buildx" for the ARM architecture and…
PhilBot
  • 748
  • 18
  • 85
  • 173
10
votes
3 answers

Can I persist yarn install cache during docker build using RUN --mount=type=bind?

I'm trying to generate and re-use a yarn install cache when building a Docker image using Docker BuildKit. The yarn cache is persisted in the directory .yarn/cache and should never be included in the final image (.yarn/cache is relative to the build…
1
2 3
9 10