Skip to content

Built-in variable BAKE_LOCAL_PLATFORM#748

Merged
tonistiigi merged 1 commit intodocker:masterfrom
crazy-max:platform-func
Sep 2, 2021
Merged

Built-in variable BAKE_LOCAL_PLATFORM#748
tonistiigi merged 1 commit intodocker:masterfrom
crazy-max:platform-func

Conversation

@crazy-max
Copy link
Copy Markdown
Member

@crazy-max crazy-max commented Aug 24, 2021

Add built-in variable BAKE_LOCAL_PLATFORM that returns the current platform's default platform specification (e.g. linux/amd64).

Signed-off-by: CrazyMax [email protected]

@tonistiigi
Copy link
Copy Markdown
Member

What's the benefit of this compared to "local" that is accepted by docker build(x) ? Also, "platform" is not a good name for this. Eg. build's default platform is the platform of the server that is definitely more common. Building for a local CLI system is more like an edge case and only works reliably in cross-compile dockerfiles as most users are on macos/windows..

@crazy-max
Copy link
Copy Markdown
Member Author

What's the benefit of this compared to "local" that is accepted by docker build(x) ? Also, "platform" is not a good name for this. Eg. build's default platform is the platform of the server that is definitely more common. Building for a local CLI system is more like an edge case and only works reliably in cross-compile dockerfiles as most users are on macos/windows..

I have a edge case where I want to be able to know the current local platform in order to use it in an HCL function. It's not for purely dedicated build usage. But yeah it can be confusing with this name. Something like localplatform lgty?

@tonistiigi
Copy link
Copy Markdown
Member

Something like localplatform lgty?

I guess that is fine. Could also be builtin var. We already added one for remotes and want to add another for --install. Probably more in the future.

@crazy-max crazy-max changed the title platform HCL func localplatform HCL func Sep 2, 2021
@crazy-max
Copy link
Copy Markdown
Member Author

@tonistiigi

Could also be builtin var. We already added one for remotes and want to add another for --install. Probably more in the future.

Yes a builtin var looks better. BAKE_LOCAL_PLATFORM lgty?

@crazy-max crazy-max changed the title localplatform HCL func Built-in variable BAKE_LOCAL_PLATFORM Sep 2, 2021
@crazy-max crazy-max marked this pull request as ready for review September 2, 2021 20:51
@tonistiigi tonistiigi merged commit fd94fc5 into docker:master Sep 2, 2021
@crazy-max crazy-max deleted the platform-func branch September 2, 2021 23:23
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.

2 participants