GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Experimental BuildKit support by tonistiigi · Pull Request #37151 · moby/moby

Conversation

@tonistiigi

@tonistiigi tonistiigi commented May 25, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

This PR adds experimental support for using moby/buildkit as a backend for docker build. #32925 #34227

The support is only enabled in the experimental daemon, and user needs to opt-in in docker/cli to start using it.

# in daemon
dockerd -D --experimental

# in Docker CLI
export DOCKER_BUILDKIT=1
docker build .

Docker CLI branch with BuildKit support enabled is in https://github.com/tonistiigi/docker-cli/tree/experimental-buildkit

In the API, version field allows switching between different build backends.

This enables lots of new capabilities, including parallel build steps and requests, skipping unused stages, efficient incremental builds, build context file detection, remote cache support, graceful cancellation, build cache issues, etc. It also enables using experimental Dockerfile features without requiring to update Moby by using the BuildKit frontend images.

The technical side of this integration is a temporary (and somewhat limited) solution as BuildKit is based on containerd storage and that has not been integrated into Moby yet. The current solution provides adapters to some components to provide compatibility between things like containerd snapshots and Moby layerstore/storage drivers or image store. When containerd storage support lands in Moby, all these adapters should be removed entirely, and BuildKit can use containerd directly. This temporary solution allows us to get feedback before we feel comfortable to move it out of experimental.

The tests will not currently use BuildKit in the PR as it requires opt-in and a new CLI binary. We have run the tests manually. Some of them need to be reworked for output change or a side-effect removal. We will continue addressing some of the test results that we are still investigating.

Known issues (some of them will not make it into 18.06 release):

  • no automatic GC (manual system df and system prune work)
  • pulling schema1 images during build
  • automatic path detection in dockerfile doesn't detect unused symlinks
  • resource limitation and --net options: execution completely bypasses the daemon, net is host.
  • windows support (depending on containerd runtime integration)
  • --pull (currently existing images in image store always take precedence)
  • USER doesn't set additional groups
  • --iidfile is not enabled in CLI
  • No way to export remote build cache. Build cache exported with standalone BuildKit can be imported with --cache-from.

@tiborvass @AkihiroSuda

depends on #36895

asciicast

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

AkihiroSuda, tiborvass, saulshanabrook, johnharris85, vdemeester, rn, idiamond-stripe, thaJeztah, ijc, beenanner, and 21 more reacted with hooray emoji tiborvass, vdemeester, vide, mavenugo, dhiltgen, billmetangmo, sirlatrom, caervs, seemethere, hinshun, and 3 more reacted with heart emoji BrunoScheufler reacted with rocket emoji
All reactions
  • 🎉 31 reactions
  • ❤️ 13 reactions
  • 🚀 1 reaction
@tonistiigi
tonistiigi requested review from dnephin, tianon and vdemeester as code owners May 25, 2018 03:13
@GordonTheTurtle GordonTheTurtle added the status/0-triage label May 25, 2018
@tiborvass tiborvass added status/1-design-review and removed status/0-triage labels May 25, 2018
@AkihiroSuda AkihiroSuda mentioned this pull request May 25, 2018
Proposal: DAG image builder (can execute muti-stage build in parallel) #32550
Closed
AkihiroSuda
AkihiroSuda reviewed May 25, 2018
View reviewed changes
Comment thread builder/builder-next/adapters/snapshot/snapshot.go
var _ snapshot.SnapshotterBase = &snapshotter{}

// NewSnapshotter creates a new snapshotter
func NewSnapshotter(opt Opt) (snapshot.SnapshotterBase, error) {

@AkihiroSuda AkihiroSuda May 25, 2018

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we split this to a separate package that wraps Moby graphdriver as a containerd snapshotter?

cc @dmcgowan

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@tonistiigi tonistiigi May 25, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, the issue is that containerd mounts are stateless while some graphdrives can't produce stateless mounts. @dmcgowan has a plan for that for Moby integration that is somewhat similar to the buildkit/snapshot.Mountable abstraction.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
AkihiroSuda
AkihiroSuda reviewed May 25, 2018
View reviewed changes
Comment thread builder/builder-next/exporter/writer.go
@@ -0,0 +1,179 @@
package containerimage

@AkihiroSuda AkihiroSuda May 25, 2018

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we dedupe writer.go with https://github.com/moby/buildkit/blob/master/exporter/containerimage/writer.go via some util pkg?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@tonistiigi tonistiigi May 25, 2018

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason I couldn't use it directly was that buildkit uses the blobsum-diffid pairs here while Moby doesn't yet have an understanding of managing layer blobs. But with a careful refactor, some parts of it can definitely be shared.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
AkihiroSuda
AkihiroSuda reviewed May 25, 2018
View reviewed changes
Comment thread api/types/client.go
BuilderV1 BuilderVersion = "1"
// BuilderBuildKit is builder based on moby/buildkit project
BuilderBuildKit = "2"
)

@AkihiroSuda AkihiroSuda May 25, 2018

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: can we just use strings rather than numbers? e.g. legacy and buildkit

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@tiborvass tiborvass May 25, 2018

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AkihiroSuda I don't like the word legacy (which is what it was initially). With all the respect I have for buildkit, with time everything becomes legacy and eventually you'll have to differentiate between legacy legacy and legacy. This problem is solved with versions, so I believe it's a better tradeoff this way. Happy to hear your concerns though.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

AkihiroSuda, vdemeester, florianeichin, and akhilerm reacted with thumbs up emoji
All reactions
  • 👍 4 reactions
AkihiroSuda
AkihiroSuda reviewed May 25, 2018
View reviewed changes
Comment thread api/types/client.go Outdated
SessionID string
Platform string
Version BuilderVersion
BuildID string

@AkihiroSuda AkihiroSuda May 25, 2018

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add godoc?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vdemeester reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@tonistiigi tonistiigi mentioned this pull request May 25, 2018
dockerfile: USER doesn't set additional group moby/buildkit#412
Closed
@vdemeester vdemeester mentioned this pull request May 25, 2018
rfc: move client/types from api/types… #37000
Closed
5 tasks
vdemeester
vdemeester reviewed May 25, 2018
View reviewed changes

@vdemeester vdemeester left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On high level, definitely Design LGTM 😻

In this PR it seems it's not possible to choose a different frontend yet right ? if yes, is it something we plan to allow before going out of experimental ?
I see the gateway.v0 frontend is there so it seems it's already possible to use custom images as frontend (which is awesome 💓) but I'm not sure how to specify it from the API standpoint.

Also, should we open a PR in docker/cli to discuss the cli design in parallel ; and also easily have a docker binary built to make manual testing easier (without having to clone and build the cli)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@tonistiigi

tonistiigi commented May 25, 2018

Copy link
Copy Markdown
Member Author

In this PR it seems it's not possible to choose a different frontend yet right ? if yes, is it something we plan to allow before going out of experimental ? I see the gateway.v0 frontend is there so it seems it's already possible to use custom images as frontend (which is awesome 💓) but I'm not sure how to specify it from the API standpoint.

Custom Dockerfile implementations can be used with a Dockerfile directive moby/buildkit#384 but generic frontends (or raw LLB) is not currently enabled in HTTP API. As this would be a new feature, it probably makes sense to do discuss/PR that separately. It may definitely happen in experimental is maintainers agree.

Also, should we open a PR in docker/cli to discuss the cli design in parallel ; and also easily have a docker binary built to make manual testing easier (without having to clone and build the cli)

There's still some cleanup stuff that needs to happen there. You can expect a PR early next week.

vdemeester reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tonistiigi tonistiigi added the rebuild/janky label May 25, 2018
@GordonTheTurtle GordonTheTurtle removed the rebuild/janky label May 25, 2018
@moby moby deleted a comment from codecov Bot May 25, 2018
@codecov

codecov Bot commented May 26, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

❗ No coverage uploaded for pull request base (master@0c4ed4e). Click here to learn what that means.
The diff coverage is 2.77%.

@@            Coverage Diff            @@
##             master   #37151   +/-   ##
=========================================
  Coverage          ?   35.33%           
=========================================
  Files             ?      609           
  Lines             ?    45000           
  Branches          ?        0           
=========================================
  Hits              ?    15901           
  Misses            ?    26947           
  Partials          ?     2152
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tonistiigi tonistiigi added the rebuild/janky label May 26, 2018
@GordonTheTurtle GordonTheTurtle removed the rebuild/janky label May 26, 2018
@cpuguy83

cpuguy83 commented May 30, 2018

Copy link
Copy Markdown
Member

Design LGTM

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vdemeester vdemeester added status/2-code-review and removed status/1-design-review labels May 30, 2018
@tonistiigi
tonistiigi force-pushed the experimental-buildkit branch from 3a6c7d4 to 71b7cd5 Compare June 4, 2018 23:31
@tiborvass tiborvass mentioned this pull request Jun 5, 2018
Support for experimental BuildKit docker/cli#1111
Merged
@tonistiigi
tonistiigi force-pushed the experimental-buildkit branch 2 times, most recently from 4937e74 to b00dc69 Compare June 6, 2018 22:07
thaJeztah
thaJeztah reviewed Jun 7, 2018
View reviewed changes
Comment thread vendor.conf Outdated

@thaJeztah thaJeztah Jun 7, 2018

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this something we can upstream? I didn't see a pull request; https://github.com/hashicorp/go-immutable-radix/pulls (looks like its this change; tonistiigi/go-immutable-radix@826af9c)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@tonistiigi tonistiigi Jun 8, 2018

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if they are interested and the project isn't very active. I can make a proper fork if needed (although we use this project for swarmkit as well). There is no functionality divergence, just an extra method that is only used by buildkit.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@thaJeztah thaJeztah Jun 8, 2018

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could try if they accept the PR, then we'd be set (unless we think we'll be adding more features and a fork would help)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

c4milo reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@tonistiigi tonistiigi Jun 8, 2018

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I'll make sure to do that and replace if it gets merged

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
thaJeztah
thaJeztah requested changes Jun 8, 2018
View reviewed changes
Comment thread vendor.conf Outdated

@thaJeztah thaJeztah Jun 7, 2018

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is using UNLICENSE; looks like that could have some implications (but IANAL); https://softwareengineering.stackexchange.com/a/147120, docopt/docopt.rs#1

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@tonistiigi tonistiigi Jun 9, 2018

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@tiborvass tiborvass added the rebuild/z label Jun 11, 2018
@GordonTheTurtle GordonTheTurtle removed rebuild/experimental labels Jun 11, 2018
AkihiroSuda
AkihiroSuda approved these changes Jun 12, 2018
View reviewed changes

@AkihiroSuda AkihiroSuda left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM if the regression is fixed now.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@tiborvass

tiborvass commented Jun 12, 2018

Copy link
Copy Markdown
Contributor

@AkihiroSuda yes, regression was on docker CLI.

AkihiroSuda reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vdemeester
vdemeester approved these changes Jun 12, 2018
View reviewed changes

@vdemeester vdemeester left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🦁

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@tiborvass

tiborvass commented Jun 12, 2018

Copy link
Copy Markdown
Contributor

CI for powerpc and s390x are known to have issues /cc @andrewhsu @seemethere.

vdemeester, thaJeztah, lukasheinrich, seemethere, and BrunoScheufler reacted with hooray emoji
All reactions
  • 🎉 5 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tiborvass
tiborvass merged commit c752b09 into moby:master Jun 12, 2018
@lowenna

lowenna commented Jun 13, 2018

Copy link
Copy Markdown
Member

This has broken master on Windows:

PS C:\> dockerd
INFO[2018-06-13T09:04:23.208583500-07:00] Windows default isolation mode: process
INFO[2018-06-13T09:04:23.294671100-07:00] Loading containers: start.
INFO[2018-06-13T09:04:23.298646300-07:00] Restoring existing overlay networks from HNS into docker
INFO[2018-06-13T09:04:23.399254200-07:00] Loading containers: done.
INFO[2018-06-13T09:04:23.402261600-07:00] Docker daemon                                 commit=692df4699c graphdriver(s)=windowsfilter version=0.0.0-dev
INFO[2018-06-13T09:04:23.405258500-07:00] Daemon has completed initialization
failed to find git binary: exec: "git": executable file not found in %PATH%
PS C:\>
tianon reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Jun 13, 2018
Dockerd no longer starts if git is not installed after buildkit merge #37278
Closed
Don't fail to start daemon if builder source is not available #37280
Merged
@tiborvass

tiborvass commented Jun 13, 2018

Copy link
Copy Markdown
Contributor

@jhowardmsft Thanks. Sorry about that. Windows CI was green :(

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lowenna

lowenna commented Jun 13, 2018

Copy link
Copy Markdown
Member

@tiborvass Yes, the CI servers have (and need) git installed :/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@thaJeztah thaJeztah mentioned this pull request Jun 16, 2018
Add ability to only build the stages that the target stage depends on #37297
Closed
@wking wking mentioned this pull request Jun 22, 2018
Document Unlicense compatibility issues? github/choosealicense.com#591
Closed
@RytisLT RytisLT mentioned this pull request Sep 24, 2018
Error on cache query moby/buildkit#569
Closed
@ybogdanov ybogdanov mentioned this pull request Jan 7, 2019
Pointers to other tools? Alternatives to MOUNT? grammarly/rocker#199
Closed
@thaJeztah thaJeztah mentioned this pull request Jul 8, 2021
Update /system/df example swagger response #42605
Closed
@thaJeztah thaJeztah added the impact/api label Sep 2, 2022
@thaJeztah thaJeztah mentioned this pull request Jan 8, 2024
builder-next: builder uses ChecksumForGraphID, which always produces error (?) #47040
Open
smoookeeey
smoookeeey reviewed Mar 7, 2024
View reviewed changes
Comment thread api/server/backend/build/backend.go
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/backend"
"github.com/docker/docker/builder"
buildkit "github.com/docker/docker/builder/builder-next"

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Dramaga11 Dramaga11 mentioned this pull request Apr 29, 2024
gitHub.com/docker/repo electron/electron#41989
Closed
@thaJeztah thaJeztah added the docs/revisit label Oct 18, 2024
This was referenced May 20, 2025
moby/buildkit: 增强 Docker build 的功能,支持并行构建、缓存、镜像导出等功能 eryajf/talk-opsre#164
Open
moby/buildkit: 增强 Docker build 的功能,支持并行构建、缓存、镜像导出等功能 awesome-ops/awesome-ops.github.io#58
Open
This was referenced Oct 14, 2025
api/types/sytem: remove deprecated DiskUsage.BuilderSize #51180
Merged
server/router/build: remove wrapOutputBufferedUntilRequestRead workaround if possible #51209
Closed
@VedantMadane VedantMadane mentioned this pull request Apr 15, 2026
server/router/build: replace output buffering workaround with EnableFullDuplex #52364
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@thaJeztah thaJeztah thaJeztah requested changes
@tiborvass tiborvass tiborvass approved these changes
@AkihiroSuda AkihiroSuda AkihiroSuda approved these changes
@dnephin dnephin Awaiting requested review from dnephin
@tianon tianon Awaiting requested review from tianon
@cpuguy83 cpuguy83 Awaiting requested review from cpuguy83
+2 more reviewers
@smoookeeey smoookeeey smoookeeey left review comments
@vdemeester vdemeester vdemeester approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@yongtang yongtang

Labels

area/builder Build docs/revisit impact/api impact/changelog kind/experimental status/2-code-review

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

11 participants

@tonistiigi @cpuguy83 @AkihiroSuda @tiborvass @lowenna @vdemeester @thaJeztah @smoookeeey @yongtang @GordonTheTurtle @dmcgowan
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.