Questions tagged [docker-buildkit]
142 questions
9
votes
3 answers
Docker build failed to compute cache key
I have the below project structure
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 4/22/2021 1:49 PM App_Start
d----- 3/20/2020 3:35 PM …

sorosh_sabz
- 2,356
- 2
- 32
- 53
9
votes
2 answers
How to use the mounted ssh in docker for subsequent commands in Dockerfile
I have to do a git push while running my container using CMD.
But the ssh is not available in the last line i.e in the CMD part, to do a git push.
What can I do here to get the ssh key for git push? Someone please help me.
Please find my…

Mohan Suresh Ramasamy
- 311
- 1
- 3
- 8
9
votes
0 answers
How do you view the docker build cache for buildkit builds?
I've gotten an image building using the new DOCKER_BUILDKIT=1 builder, specifically to use --mount=cache. After building my image a couple times I noticed the cache usage is already past 3Gb, I'd like to see the size of the objects in the cache to…

Xavier Denis
- 406
- 3
- 14
8
votes
1 answer
What exactly is the frontend and backend of docker buildkit?
I am exploring the docker build process using the Buildkit. I have enabled it by setting an environment variable DOCKER_BUILDKIT=1 on the CLI before invoking docker build. From the buildkit documentation it says,
To use an external Dockerfile…

Kishor Unnikrishnan
- 1,928
- 4
- 21
- 33
8
votes
1 answer
Docker build: how to get full RUN command output?
Update: This question is refactored with a MVRE.
Is there a way I can see the full RUN command from a Dockerfile built with docker build?
E.g. if my Dockerfile has the statement:
# Dockerfile
FROM alpine:3.7 as base
RUN echo "this is the song that…

StoneThrow
- 5,314
- 4
- 44
- 86
8
votes
2 answers
Docker BuildKit --mount=type=cache not working, why?
I am trying to implement Buildkit's cache mount feature.
My Dockerfile is:
# syntax = docker/dockerfile:experimental
FROM python:3.6-alpine
RUN --mount=type=cache,target=/root/.cache/pip pip install pyyaml
CMD: docker build --progress=plain -t…

codersofthedark
- 9,183
- 8
- 45
- 70
7
votes
2 answers
How to Use Docker Build Secrets with Kaniko
Context
Our current build system builds docker images inside of a docker container (Docker in Docker). Many of our docker builds need credentials to be able to pull from private artifact repositories.
We've handled this with docker secrets..…

treekong
- 111
- 6
6
votes
1 answer
How to use secrets when building docker compose locally
I recently started using Buildkit to hide some env vars, and it worked great in prod by gha!
My Dockerfile now is something like this:
# syntax=docker/dockerfile:1.2
...
RUN --mount=type=secret,id=my_secret,uid=1000 \
MY_SECRET=$(cat…

Jonatan Lavado
- 954
- 2
- 15
- 26
6
votes
2 answers
"docker build" requires exactly 1 argument
I just want to build a dockerfile from a different directory, I tried the following command
docker build -f C:/Users/XXXX/XXXX/XXXX/XXXX/XXXX/Dockerfile
and
docker build -f C://Users/XXXX/XXXX/XXXX/XXXX/XXXX/Dockerfile
Both of them yield the same…

Ajay Sabarish
- 171
- 2
- 6
6
votes
0 answers
Missing /v8 variant from linux/arm64 platform
I'm using buildx for my multiarch Docker build.
The base image python:3.8.5-alpine has linux/arm64/v8 as one of its OS/archs, but the resulting image (corralpeltzer/newtrackon) has the variant /v8 missing, creating an image with linux/arm64 in its…

Miguel Ángel Corral Peltzer
- 61
- 2
- 6
6
votes
1 answer
Does the order of --cache-from arguments matter when building an image with Docker Buildkit?
Suppose I am building an image using Docker Buildkit. My image is from a multistage Dockerfile, like so:
FROM node:12 AS some-expensive-base-image
...
FROM some-expensive-base-image AS my-app
...
I am now trying to build both images. Suppose that…

ecbrodie
- 11,246
- 21
- 71
- 120
5
votes
1 answer
How to specify where to push using docker buildx build command
I was reading the docs regarding docker buildx build to build to multiple architectures and I got puzzled with the --push option, it says that it pushes to the registry directly but how does it know or how can I specify where I want it to push the…

RabidTunes
- 775
- 1
- 8
- 21
5
votes
1 answer
Running BuildKit using docker buildx behind a proxy
My organization uses a http/https proxy. Traffic to the internet must be routed via this proxy.
We're adding multi-architecture support to our jenkins pipelines which build and push the docker images. The HTTP_PROXY and HTTPS_PROXY environment…

darthcrumpet
- 343
- 2
- 5
- 13
5
votes
0 answers
How to increase the amount of lines shown by Docker BuildKit?
When building a Docker image with BuildKit enabled, it only shows the last 6 lines the build log at the same time. --progress=plain shows all the thousands of lines at once but I would like to get something in between, let's say 20. Is it possible…

Konrad Höffner
- 11,100
- 16
- 60
- 118
5
votes
1 answer
Caching Go Depencencies in Docker
I've read articles in which it is advised to have a dedicated go mod download layer for downloading go dependencies. I understand that the layer is cached and if the dependencies don't change in the next build, the cached layer will be used, saving…

Danial
- 362
- 4
- 18