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

Fix multi-platform builds with multiple aliases. #1651

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

zarthross
Copy link
Contributor

Multi-platform builds append a -t argument for each alias to the dockerBuildOptions, but the publishTask function was ALWAYS iterating over the aliases even if it was a multi-platform build.

dockerBuildOptions := Seq("--force-rm") ++ dockerAliases.value.flatMap { alias =>
Seq("-t", alias.toString)
} ++ { if (dockerBuildInit.value) List("--init") else Nil },

The consequence was attempts to buildx and push the tags multiple times. In some environments this leads to build failures because you can't push the same tag twice.

This change simply does not iterate over the aliases for multiplatform builds.

Note: using dockerUpdateLatest := true counts as having multiple aliases, which is how I encountered this bug.

Multi-platform builds append a `-t` argument for each alias to the
`dockerBuildOptions`, but the `publishTask` function was ALWAYS
iterating over the aliases even if it was a multi-platform build.

The consequence was attempts to buildx and push the tags multiple times.
In some environments this leads to build failures because you can't push
the same tag twice.

This change simply does not iterate over the aliases for multiplatform builds.
@lightbend-cla-validator

Hi @zarthross,

Thank you for your contribution! We really value the time you've taken to put this together.

We see that you have signed the Akka Contributors License Agreement before, however, the CLA has changed since you last signed it.
Please review the new CLA and sign it before we proceed with reviewing this pull request:

http://www.lightbend.com/contribute/cla

@zarthross
Copy link
Contributor Author

The CLA signer process is broken... I cannot sign it... not sure what ya'll want to do about it.

@zarthross
Copy link
Contributor Author

This is basically a 1 line fix, i do not care about the CLA, i do not care about copy right to the code, just wanted others to have the fix.....

@dwickern
Copy link
Collaborator

The CLA bot has an insecure http: URL... This link should work: https://www.lightbend.com/contribute/cla

@muuki88
Copy link
Contributor

muuki88 commented Nov 25, 2024

We'll get rid of the CLA after #1653

@muuki88 muuki88 merged commit c882ac2 into sbt:main Nov 25, 2024
15 of 16 checks passed
@muuki88
Copy link
Contributor

muuki88 commented Nov 25, 2024

Thanks a lot 🙏

@zarthross
Copy link
Contributor Author

@muuki88 Thanks for merging!

@zarthross zarthross deleted the fix-multiplatform-multi-alias-builds branch November 25, 2024 15:01
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.

4 participants