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

Add support for buildx #131

Merged
merged 2 commits into from
Mar 6, 2023
Merged

Conversation

nik-kashi
Copy link
Contributor

It enables to create of cross-platform images
For using the cross-platform builds, the platforms property should have been valued

It enables to create cross-platform images

The `--load` parameter is required for `buildx` to create an image
@nik-kashi
Copy link
Contributor Author

This PR addresses #129

@marcuslonnberg FYI

"--file" ::
dockerfilePath.name ::
dockerfileAbsolutePath.getPath ::
Copy link
Contributor Author

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")
Copy link
Contributor Author

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

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).

Copy link
Contributor Author

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

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.

@marcuslonnberg marcuslonnberg merged commit 5c3e4c5 into marcuslonnberg:master Mar 6, 2023
@marcuslonnberg
Copy link
Owner

Looks good, thanks! 👏
I'll try to make a release in the next day.

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.

None yet

3 participants