dockerdocker-buildkit

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

Solution

  • Update: as commented by @N1ngu, if you're doing these steps on recent versions (>= 22), check vendor.mod instead of vendor.conf.

    I don't think it does. My Docker version is pretty recent (20.10.12) and has a buildkit version that precedes that. Here's what I did to try to check:

    1. Get the commit id for my current version of docker:
    $docker --version
    Docker version 20.10.12, build e91ed5707e
    
    1. Find the commit on github (or locally if you clone the repo)

    2. Check the commit specified for buildkit on vendor.conf for that version:

    github.com/moby/buildkit                            8142d66b5ebde79846b869fba30d9d30633e74aa # v0.8.1
    
    1. Compare these commits on buildkit's repository. On this page, you can see that 8142d66, the version Docker 20.10.12 bundles, precedes aa46719. If it was the opposite, the comparison tool would the branch as up-to-date, like what happens if you invert the commits in the URL.