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

Built-in variable BAKE_LOCAL_PLATFORM#748

Merged
merged 1 commit into from
Sep 2, 2021

Conversation

crazy-max
Copy link
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 crazy-max@users.noreply.github.com

@tonistiigi
Copy link
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
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
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
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
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
@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