Skip to content

Conversation

@crazy-max
Copy link
Member

@crazy-max crazy-max commented Dec 4, 2025

relates to docker/buildx#3520 (review) and internal discussions.

Refactor the inputs for our workflows to be more consistent with our upstream actions and also avoid confusion like docker/buildx#3520 (review).

@crazy-max crazy-max force-pushed the build-inputs branch 9 times, most recently from 65a88d8 to ee9ed7a Compare December 4, 2025 14:10
@crazy-max crazy-max marked this pull request as ready for review December 4, 2025 15:10
@dvdksn
Copy link

dvdksn commented Dec 4, 2025

Yes @crazy-max would be great to keep examples here until we have something on docs.docker.com

@crazy-max crazy-max force-pushed the build-inputs branch 3 times, most recently from c13ca88 to e9c5806 Compare December 5, 2025 09:39
@crazy-max
Copy link
Member Author

crazy-max commented Dec 5, 2025

@tonistiigi Pushed extra commit to remove GHA cache for now related to #56

@crazy-max crazy-max force-pushed the build-inputs branch 2 times, most recently from bb98b55 to d99e23b Compare December 5, 2025 12:42
envs:
type: string
description: "Which scope cache object belongs to if cache enabled (defaults to target name if set)"
description: "Environment variables to inject in the reusable workflow as list of key-value pair. This is similar to the GitHub Actions env context but as it cannot be used when calling a reusable workflow, we need to define our own input"
Copy link
Member

Choose a reason for hiding this comment

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

What is the use-case?

Copy link
Member Author

@crazy-max crazy-max Dec 16, 2025

Choose a reason for hiding this comment

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

For build or bake, people might want to pass environment variables to the workflow for build-args with build or more importantly for bake to solve variables in the bake definition like: https://github.com/moby/buildkit/pull/6388/files#diff-edc3cacddc1f4df8e0e08c34f870525dffdf521312794ee0f1bccd1638534385R245-R248

Copy link
Member Author

Choose a reason for hiding this comment

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

After offline discussion let's remove this input. User can either use build-args or bake override.

description: "List of build-time variables. If you want to set a build-arg through an environment variable, use the envs input"
required: false
meta-tags:
context:
Copy link
Member

Choose a reason for hiding this comment

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

Do we validate that this can only be subpath for now? Should we call something like subpath.

I think we could be open to supporting external repositories here in the future but it should be create from the validation side that these would require a different kind of policy rules.

Copy link
Member Author

@crazy-max crazy-max Dec 16, 2025

Choose a reason for hiding this comment

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

Do we validate that this can only be subpath for now? Should we call something like subpath.

Yes for build or bake this can only be a subdir of the Git context (defaults to .):

I think we could be open to supporting external repositories here in the future but it should be create from the validation side that these would require a different kind of policy rules.

I see yeah that makes sense

description: "Raw authentication to registries, defined as YAML objects (for image output)"
required: false
github-token:
description: "GitHub Token used to authenticate against a repository for Git context"
Copy link
Member

Choose a reason for hiding this comment

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

So this is for external Git repositories?

Copy link
Member Author

@crazy-max crazy-max Dec 16, 2025

Choose a reason for hiding this comment

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

Not for external Git repos, we need to be able to fetch private repos which requires the GitHub Token set and used via GIT_AUTH_TOKEN:

Similar to what build-push-action and bake-action do today for Git context

@crazy-max crazy-max force-pushed the build-inputs branch 3 times, most recently from 537c77b to e7da8ba Compare December 16, 2025 11:47
@crazy-max crazy-max mentioned this pull request Dec 16, 2025
@crazy-max crazy-max force-pushed the build-inputs branch 3 times, most recently from b9b7b8c to f37af04 Compare December 17, 2025 11:06
Comment on lines 145 to 151
The [`build.yml` reusable workflow](.github/workflows/build.yml) lets you build
container images and artifacts from a Dockerfile with a user experience similar
to [`docker/build-push-action`](https://github.com/docker/build-push-action/).
It provides a Docker-maintained, opinionated build pipeline that applies best
practices for security, performance, and reliability by default, including
isolated execution and signed SLSA provenanc while keeping per-repository
configuration minimal.
Copy link
Member Author

Choose a reason for hiding this comment

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

@dvdksn Added this related to #61 (comment)

Copy link

Choose a reason for hiding this comment

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

Can we add a similar but shorter note under the bake section to call out that it's a replacement for / composite of the docker/bake-action + ancillary support actions.

Copy link
Member Author

@crazy-max crazy-max Dec 17, 2025

Choose a reason for hiding this comment

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

Yes I've done it in #65 but will move changes from this PR here.

Edit: moved and #65 closed

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
@crazy-max crazy-max changed the title build: refactor inputs refactor build and bake inputs Dec 17, 2025
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
@crazy-max crazy-max merged commit dc9af42 into main Dec 18, 2025
112 checks passed
@crazy-max crazy-max deleted the build-inputs branch December 18, 2025 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants