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

Expose default dockerfile syntax version being used #2459

Open
miki725 opened this issue May 15, 2024 · 3 comments
Open

Expose default dockerfile syntax version being used #2459

miki725 opened this issue May 15, 2024 · 3 comments

Comments

@miki725
Copy link

miki725 commented May 15, 2024

Description

Currently dont think there is an easy way to figure out what dockerfile syntax is going to be used if dockerfile does not define # syntax=... directive.

My understanding is that buildx pins a version of buildkit:

buildx/go.mod

Line 29 in afcb609

github.com/moby/buildkit v0.13.0-rc3.0.20240417151852-71f99c52a669 // v0.14.0-dev

which in turn contains a frontend implementation in https://github.com/moby/buildkit/tree/28264b45d924d654616f1fba1467aa0a4cefaab5/frontend

To map that to dockerfile syntax as published in https://docs.docker.com/build/dockerfile/release-notes/ is non-trivial.

Sometimes it would be useful to know what capabilities are available in dockerfile syntax by being able to query/find out what version of dockerfile is used by default.

Perhaps docker buildx version can be extended to include that information or maybe adding docker buildx info command similar to docker info which will show more information about internal buildx sub-systems is going to be very useful.

@miki725 miki725 added kind/enhancement New feature or request status/triage labels May 15, 2024
@tonistiigi
Copy link
Member

My understanding is that buildx pins a version of buildkit:

You can run docker buildx inspect to see the BuildKit version of the current builder instance (that can then be mapped to Dockerfile version). go.mod has the version buildx libraries used when it was compiled that could be different from the daemon version. For instances created with buildx create, they always use the latest stable buildkit version if one was not set with the flags.

@miki725
Copy link
Author

miki725 commented May 16, 2024

Ah nice. Didn't realize inspect showed buildkit version. Would be nice if it would show the dockerfile syntax version there as well.

@crazy-max
Copy link
Member

Would be nice if it would show the dockerfile syntax version there as well.

When implementing the info service in BuildKit I was thinking it would be useful as well: moby/buildkit#2725 (comment) but seems a bit messy to manage in our code base: moby/buildkit#2725 (comment)

Relevant commit: crazy-max/buildkit@43ad8ab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants