Questions tagged [docker-buildkit]

142 questions
5
votes
1 answer

How to check the default buildkit version?

Background I want to check if my current docker setup with BuildKit contains this commit. Question How do I find out what BuildKit versions docker uses when I build an image with DOCKER_BUILDKIT=1 docker build
Rufus
  • 5,111
  • 4
  • 28
  • 45
5
votes
1 answer

Can build args used for a Docker image be extracted from it?

There are claims that build arguments of a Docker image can be extracted after you pull the image (example). I've tested this with the following Dockerfile: FROM scratch ARG SECRET ADD Dockerfile . When I build the image: $ docker build -t…
Koterpillar
  • 7,883
  • 2
  • 25
  • 41
5
votes
1 answer

Right way to use secret flag in docker buildkit

I am struggling with the same problem mentioned by Gavin on this question. Specifically in with new docker build secret information What is the right way to use it that feature? Looking around on the internet I only found some variations of the same…
redesaid
  • 63
  • 2
  • 7
5
votes
1 answer

Don't use layer cache, but do use mount-cache when using docker+buildkit

When using buildkit, using the docker cli frontend, I sometimes do not want to use layer-cache, but do want to rely on the newer mount-cache type. RUN --mount=type=cache,target=... However running docker build --no-cache seemingly disables both. Is…
hbogert
  • 4,198
  • 5
  • 24
  • 38
5
votes
1 answer

Add variable to dockerfile{} section in Jenkinsfile to enable docker_buildkit

This is snipshet of my code: stage('tf run') { agent { dockerfile { additionalBuildArgs "${ADDITIONAL_BUILD_ARGS}" registryCredentialsId "${REGISTRY_CREDENTIALS}" registryUrl "${REGISTRY_URL}" reuseNode true } …
debek
  • 331
  • 7
  • 15
5
votes
2 answers

docker buildkit not supported by daemon in AWS EKS kubernetes cluster

I am using Build Toolkit to build docker image for each microservice. ./build.sh export DOCKER_BUILDKIT=1 # .... docker build -t .... # ... This works on my machine with docker (18.09.2). However, it does not work with Jenkins, that I setup as…
Abdennour TOUMI
  • 87,526
  • 38
  • 249
  • 254
4
votes
1 answer

Docker BuildKit not Parallelizing Independent Stages without `echo`s

Assume export DOCKER_BUILDKIT=1. Take main.py: i = 0 while True: i += 1 Take this Dockerfile: FROM python:3.9-slim as base COPY main.py . FROM base as part_1 RUN echo "A" && python -m main FROM base as part_2 RUN echo "B" && python -m…
4
votes
1 answer

How to ignore docker buildkit flags when building normally

I have a docker container which I would like to build with buildkit sometimes and with standard docker build other times. Imagine we have a container like: # syntax=docker/dockerfile:experimental FROM python:3.8 # Install all necessary libraries…
nbertagnolli
  • 418
  • 5
  • 10
4
votes
0 answers

Using docker buildkit caching with R-packages

I'm trying to use the docker buildkit approach to caching packages to speed up adding packages to docker containers. I learned about it from the instructions for both python and apt-get packages and useful Stackexchange answer on caching python…
jameshowison
  • 151
  • 8
4
votes
1 answer

Buildctl command to tag multiple images

I am using Buildkit to build and push the images. I would like to add multiple tags on the images in buildctl command. For eg buildctl build --frontend=dockerfile.v0 --local context=. --local dockerfile=.…
PREETI BANSAL
  • 185
  • 2
  • 12
3
votes
1 answer

Can I use Docker buildkit to provide an ssh key to a non-root user?

I have had trouble using buildkit's RUN --mount=type=ssh as a non-root user. Using this command: eval $(ssh-agent) ssh-add ~/.ssh/id_ed25519 DOCKER_BUILDKIT=1 docker build --ssh default=${SSH_AUTH_SOCK} . And this Dockerfile: FROM…
MatrixManAtYrService
  • 8,023
  • 1
  • 50
  • 61
3
votes
1 answer

Using docker buildx github action cache without official actions

TL;DR: How can I find manually ACTIONS_RUNTIME_TOKEN and ACTIONS_CACHE_URL in GitHub actions? Context I am trying to cache docker layers during a buildkit build in GitHub actions. In theory, it's easy with the docker/setup-buildx-action,…
3
votes
1 answer

Poetry and buildkit mount=type=cache not working when building over airflow image

I have 2 examples of docker file and one is working and another is not. The main difference between the 2 is the base image. Simple python base image docker file: # syntax = docker/dockerfile:experimental FROM python:3.9-slim-bullseye RUN apt-get…
Ioan Grozea
  • 115
  • 1
  • 11
3
votes
2 answers

ssh key in Dockerfile returning Permission denied (publickey)

I'm trying to build a Docker image using DOCKER_BUILDKIT which involves cloning a private remote repository from GitLab, with the following lines of my Dockerfile being used for the git clone: # Download public key for gitlab.com RUN mkdir -p -m…
JackLidge
  • 391
  • 4
  • 16
3
votes
1 answer

Is there a way to create multiple tags using the buildx build command in docker?

I am trying to use the docker buildx build command and I would like to be able to create multiple tags in one line. An example of what I have tried docker buildx build . \ --platform linux/arm64,linux/amd64 \ --no-cache --push \ -t…
Old Man Programmer
  • 589
  • 3
  • 6
  • 14
1 2
3
9 10