Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document legacy build vs BuildKit differences #15477

Merged
merged 2 commits into from
Oct 22, 2022

Conversation

andreisilviudragnea
Copy link
Contributor

@andreisilviudragnea andreisilviudragnea commented Aug 24, 2022

Proposed changes

I documented how legacy engine executes all stages of a multi-stage Dockerfile from the beginning of the Dockerfile up to the target stage, even if target stage does not depend on some intermediate stages. When BuildKit is enabled, this (possible bug) does not happen and only transitive dependency stages of the target stage get executed.

I also documented that BuildKit is not enabled by default on all platforms (it is on macOS, but not on Linux) and that multi-stage builds should always be executed with BuildKit enabled in order to avoid the problem described above.

Related issues

Fixes #12231

@netlify
Copy link

netlify bot commented Aug 24, 2022

Deploy Preview for docsdocker ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 06c9675
🔍 Latest deploy log https://app.netlify.com/sites/docsdocker/deploys/63065fffb8281b00094ca9cf
😎 Deploy Preview https://deploy-preview-15477--docsdocker.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@craig-osterhout craig-osterhout added the area/build Relates to Dockerfiles or docker build command label Aug 24, 2022
@andreisilviudragnea
Copy link
Contributor Author

@craig-osterhout When will this be reviewed and merged?

@usha-mandya
Copy link
Member

@andreisilviudragnea Could you rebase the PR?

@netlify
Copy link

netlify bot commented Oct 20, 2022

Deploy Preview for docsdocker ready!

Name Link
🔨 Latest commit 017cc33
🔍 Latest deploy log https://app.netlify.com/sites/docsdocker/deploys/6353e6b993c6d70008987367
😎 Deploy Preview https://deploy-preview-15477--docsdocker.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@andreisilviudragnea
Copy link
Contributor Author

@usha-mandya Done.

@usha-mandya
Copy link
Member

Thank you @andreisilviudragnea. One of our team members will take a look and get back to you.

Copy link
Contributor

@dvdksn dvdksn left a comment

Choose a reason for hiding this comment

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

I think saying "moby vs buildkit" is confusing, in part since buildkit is also a moby project 😅 I think I would prefer if we could refer to it as "legacy vs buildkit", as we do on this page

build/building/multi-stage.md Outdated Show resolved Hide resolved
build/building/multi-stage.md Outdated Show resolved Hide resolved
build/building/multi-stage.md Outdated Show resolved Hide resolved
build/building/multi-stage.md Outdated Show resolved Hide resolved
build/building/multi-stage.md Outdated Show resolved Hide resolved
build/building/multi-stage.md Outdated Show resolved Hide resolved
build/building/multi-stage.md Outdated Show resolved Hide resolved
build/building/multi-stage.md Outdated Show resolved Hide resolved
Co-authored-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
@andreisilviudragnea andreisilviudragnea changed the title Document Moby vs BuildKit differences Document legacy build vs BuildKit differences Oct 22, 2022
@andreisilviudragnea andreisilviudragnea requested review from dvdksn and removed request for crazy-max, jedevc and usha-mandya October 22, 2022 12:53
Copy link
Contributor

@dvdksn dvdksn left a comment

Choose a reason for hiding this comment

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

lgtm, thanks a lot @andreisilviudragnea

@dvdksn dvdksn enabled auto-merge (squash) October 22, 2022 18:01
@dvdksn dvdksn merged commit 278f595 into docker:master Oct 22, 2022
@andreisilviudragnea andreisilviudragnea deleted the moby-buildkit-diffs branch October 23, 2022 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build Relates to Dockerfiles or docker build command
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Recommend Buildkit for using multi-stage builds
5 participants