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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zarthross
Copy link

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
Author

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

@zarthross
Copy link
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

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.

3 participants