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

Native builder required for targeting different ARCH #42

Open
jahkeup opened this issue Aug 24, 2020 · 4 comments
Open

Native builder required for targeting different ARCH #42

jahkeup opened this issue Aug 24, 2020 · 4 comments

Comments

@jahkeup
Copy link
Member

jahkeup commented Aug 24, 2020

Image I'm using:

n/a

Issue and Feature Request:

The build process is unable to produce an arm64v8 architecture specific image. The build's Dockerfile uses a scratch based container image and, on my machine at least, the requested architecture is not set for this image (with ARCH=arm64).

docker build uses the native architecture for scratch and does not support setting platform in builder. Using Docker's buildx works when setting platform at the top of the build:

docker buildx build --platform linux/arm64 ... # existing arguments

However, this would require users to install the buildx plugin and isn't a reasonable ask.

This issue should define a solution towards a correctly building a non-native architecture targeted image OR take steps to set the image's correct architecture at/following build.

@jahkeup jahkeup added the bug label Sep 1, 2020
@jhaynes jhaynes added this to the Backlog milestone May 21, 2021
@jhaynes jhaynes modified the milestones: Backlog, Tech debt May 21, 2021
@gthao313 gthao313 self-assigned this Jun 2, 2021
@jhaynes jhaynes modified the milestones: Tech debt, next Jul 28, 2021
@cbgbt cbgbt modified the milestones: next, next+1 Sep 7, 2021
@cbgbt
Copy link
Contributor

cbgbt commented Feb 21, 2022

We've investigated this issue and found that, at the time, there doesn't seem to be a way to convince docker to change the architecture of a resulting image, other than through buildx. This was through research in late 2021, so it may have changed now. Worth keeping this issue in the backlog, as this would be a really useful feature.

@cbgbt cbgbt modified the milestones: brupop 0.1.x next, Backlog Feb 21, 2022
@gthao313 gthao313 removed their assignment Nov 17, 2022
@stmcginnis
Copy link
Contributor

FWIW, I think buildx is more prevalent now than when this issue was created, and is the de facto way to be able to build cross architecture images. So I think it would be perfectly reasonable to update things to use buildx.

@jpculp
Copy link
Member

jpculp commented Dec 12, 2022

For what it's worth, we also made updates to the admin and control container Dockerfiles to be compatible with buildx, although we still don't use it in the Makefiles.

@jpmcb
Copy link
Contributor

jpmcb commented Dec 12, 2022

FWIW, I think buildx is more prevalent now than when this issue was created, and is the de facto way to be able to build cross architecture images. So I think it would be perfectly reasonable to update things to use buildx.

I actually looked at this abit when I went down the rabbit hole of arm builds for bottlerocket and testsys (see bottlerocket-os/bottlerocket-test-system#90 & bottlerocket-os/bottlerocket-test-system#509)

But I quickly discovered a roadblock; our bottlerocket SDK's manifest is not multi-arch. So attempting to build a multiarch manifest from a single docker target (instead, it uses a build-arg to determine the architecture and then pushes a separate image per arch.)

So, there may be changes to happen in dependent images (aka, the SDK) to make this possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants