-
Notifications
You must be signed in to change notification settings - Fork 111
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
Add support for buildx
#131
Conversation
It enables to create cross-platform images The `--load` parameter is required for `buildx` to create an image
This PR addresses #129 @marcuslonnberg FYI |
"--file" :: | ||
dockerfilePath.name :: | ||
dockerfileAbsolutePath.getPath :: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using an absolute path makes the command more readable and portable
@@ -113,19 +113,23 @@ object DockerBuild { | |||
var lines = Seq.empty[String] | |||
|
|||
def runBuild(buildKitSupport: Boolean): Int = { | |||
val buildX = if (buildOptions.platforms.isEmpty) Nil else List("buildx") | |||
val load = if (buildOptions.platforms.isEmpty) Nil else List("--load") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The --load
parameter is needed for buildx
to create the image
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't the --load
flag only work for single-platform builds?
From docker docs:
Currently, multi-platform images cannot be exported with the docker export type. The most common usecase for multi-platform images is to directly push to a registry (see registry).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushing directly to a registry makes breaking changes in this library. Feel free to create a PR that supports multiple platforms in one build
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that's currently possible when the docker buildx build
command doesn't support it.
Looks good, thanks! 👏 |
It enables to create of cross-platform images
For using the cross-platform builds, the
platforms
property should have been valued