Skip to content

read bake definition files from remote context support#82

Merged
crazy-max merged 1 commit intodocker:masterfrom
crazy-max:remote
Jun 25, 2022
Merged

read bake definition files from remote context support#82
crazy-max merged 1 commit intodocker:masterfrom
crazy-max:remote

Conversation

@crazy-max
Copy link
Member

Signed-off-by: CrazyMax crazy-max@users.noreply.github.com

@crazy-max crazy-max requested review from jedevc and tonistiigi June 23, 2022 13:25
src/context.ts Outdated
async function getBakeArgs(inputs: Inputs, buildxVersion: string): Promise<Array<string>> {
const args: Array<string> = ['bake'];
if (inputs.remote) {
args.push(inputs.remote);
Copy link

Choose a reason for hiding this comment

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

Do we need special logic for this if no other opts are specified?
i.e. what happens if we have {inputs.remote} {inputs.targets...}?

Copy link
Member Author

Choose a reason for hiding this comment

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

README.md Outdated
| `load` | Bool | Load is a shorthand for `--set=*.output=type=docker` (default `false`) |
| `push` | Bool | Push is a shorthand for `--set=*.output=type=registry` (default `false`) |
| `set` | List | List of [targets values to override](https://github.com/docker/buildx/blob/master/docs/reference/buildx_bake.md#set) (eg: `targetpattern.key=value`) |
| `remote` | String | Read bake definition files from [remote context](https://github.com/docker/buildx/blob/master/docs/guides/bake/file-definition.md#remote-definition) |
Copy link

Choose a reason for hiding this comment

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

It seems like multiple remotes are allowed? If so, should this be a List instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

@crazy-max crazy-max Jun 23, 2022

Choose a reason for hiding this comment

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

Oh actually you're right we can define remote bake files and remote context with a 2nd arg that will be used if BAKE_CMD_CONTEXT is defined: https://github.com/docker/buildx/blob/3cf549a7f7ee015cabe99d4a08e4b9aabfc83ccc/commands/bake.go#L46-L50

@tonistiigi
Copy link
Member

We call this "remote" internally but not sure if this is the best name for the users. Even something like "source", although overused, might be better.

@crazy-max
Copy link
Member Author

crazy-max commented Jun 23, 2022

We call this "remote" internally but not sure if this is the best name for the users. Even something like "source", although overused, might be better.

Yes was not sure myself about its name. Maybe I can just use files input and detect if a value is a remote one and place it as an arg in the cmd line?

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
@crazy-max
Copy link
Member Author

renamed source. In a follow-up we could also add a source-context input to access the main context when a bake definition has been imported remotely with source input.

@crazy-max crazy-max merged commit eff809a into docker:master Jun 25, 2022
@crazy-max crazy-max deleted the remote branch June 25, 2022 11:17
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.

3 participants