Repository navigation
Conversation
Signed-off-by: CrazyMax <[email protected]>
Allow build and bake to select an explicit image pull policy while preserving existing boolean values and driver-dependent defaults. Gate never on the builder capability so unsupported builders fail instead of silently pulling images. Preserve boolean Bake serialization and expressions while accepting policy strings and command-line overrides. Signed-off-by: CrazyMax <[email protected]>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add
--pull=always|missing|neverto build and Bake, including Bake target attributes and overrides.alwaysforces registry resolution,missingprefers the worker's local image store, andneverdisables registry resolution and image fetching, failing when required content is unavailable locally. Existing boolean values remain supported, bare--pullstill meansalways, and omitting the flag or passing--pull=falsepreserves the driver's existing behavior.The
neverpolicy requires the BuildKit capability introduced in moby/buildkit#7457 and fails explicitly on unsupported builders. It also applies to image-backed named contexts and external Dockerfile frontends selected through#syntaxorBUILDKIT_SYNTAX. Other policies retain the existing frontend-resolution behavior.I'm keeping this PR in draft until we manage persistent tag-to-digest resolution for the Dockerfile frontend which I think is needed. Loading an external frontend currently caches its content without registering its tag in the worker's image store, so a successful online build does not guarantee that the same tagged frontend can be reused with
--pull=never. A digest-pinned frontend can reuse locally cached content, but the usual tagged#syntaxdirective needs this additional work.