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 dockerBuildxPlatforms #3419

Merged
merged 1 commit into from
Sep 28, 2024
Merged

Conversation

barryoneill
Copy link
Contributor

Continuing on #2590, this allegedly will trigger buildx during a CI build

@mzuehlke
Copy link
Member

Did you tried if this locally would build a multi arch image ?
CI isn't a help here ...

@barryoneill
Copy link
Contributor Author

Sorry, I phrased that badly. Adding dockerBuildxPlatforms should trigger Docker / publish to use buildx to generate the multi-arch manifests.

Unfortunately, I can't use Docker / publish locally, since I use podman as my container engine and it doesn't support the necessary push flags. Docker / publishLocal will use the regular build mechanisms, which is what I use locally, hence my comment about CI.

If I have time this week I'll try and find/setup a non-podman environment to test this.

@barryoneill
Copy link
Contributor Author

Alright, I think I have made progress. For anyone else fighting with this on mac m1 - don't use podman. I switched to orbstack, and added the following to the 'Advanced Engine Config' in the orbstack settings:

{
  "features" : {
    "containerd-snapshotter" : true
  }
}

And I was able to use sbt Docker / publish up till it tried to publish to Docker hub (which of course I don't have permission to :))

I changed the supported architectures to what I could see in eclipse-temurin:21-alpine, i.e.

❯ docker manifest inspect eclipse-temurin:21-alpine | jq '.manifests[].platform'
{
  "architecture": "amd64",
  "os": "linux"
}
{
  "architecture": "arm64",
  "os": "linux",
  "variant": "v8"
}

@mzuehlke Should be good to go now.

Copy link
Member

@mzuehlke mzuehlke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for investigating, makes sense 👍

@mzuehlke mzuehlke merged commit 4d68023 into scala-steward-org:main Sep 28, 2024
5 checks passed
@mzuehlke
Copy link
Member

I reverted this PR, because publishing failed: https://github.com/scala-steward-org/scala-steward/actions/runs/11083098359/job/30797020608

It seems the whole publish docker procedure would need to be adapted su support using buildx like described here:
https://docs.docker.com/build/building/multi-platform/

@barryoneill
Copy link
Contributor Author

To me it seems like this project would be better served by building the docker image manually, giving more direct control over the build process, rather than being limited by whatever sbt-docker is doing with buildx under the hood.

Might also be easier to just wait till later in the year and build on arm64 when github makes it available open source projects later in the year, but that would mean duplicate builds, rather than one buildx invocation.

@mzuehlke I really appreciate the help with these PRs, sorry it didn't work out. Can you please reopen #2590 in case someone else wants to get involved!

@mzuehlke
Copy link
Member

I reopened the ticket

@mzuehlke mzuehlke added this to the 0.31.0 milestone Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants