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

Docker image for ARM64 (aarch64) #40

Open
ghost opened this issue Apr 9, 2021 · 8 comments
Open

Docker image for ARM64 (aarch64) #40

ghost opened this issue Apr 9, 2021 · 8 comments

Comments

@ghost
Copy link

ghost commented Apr 9, 2021

Docker image is only for AMD64, in my current project I need arm64, is there a way to compile docker image for arm64?
Maybe having arm64 docker is also worthy?

@niv
Copy link

niv commented Mar 26, 2022

@moigagoo

Here's my attempt: https://hub.docker.com/r/nivviv/nim

Dear reader: Please don't use my images. They're for personal/hobby projects and I make no guarantees. If you want to steal the script to build your own images though, have at it!

As to getting arm64 into the official images:

You'll have to refactor the build system to use buildx instead, which is already part of Docker Desktop on mac, and should also be on Linux; then it can cross-compile locally (even on x64). Note, however, that buildx runs in qemu so depending on your CPU, this can take an hour or longer.

My images seem to be a bit smaller than yours. The main differentiator I had seen is combining the wget/unpack/build/rm into a single RUN layer. Dockerfile doesn't seem to be smart enough to combine them.

I haven't built ubuntu images (yet) because the alpine ones seem fine. I also haven't made ONBUILD variants because I think that's kind of obsolete with multi-FROM in docker. My repo readme has an example on how to use it.

To reproduce this process in the official images:

  • buildx create --use --bootstrap (run once or write a tester like I did so that it doesn't create lots of dummy envs)
  • docker buildx build ...... --platform linux/arm64,linux/amd64 --push . You need to say --push and it will immediately push to dockerhub. buildx cannot import into the local registry for testing if you do multi-arch (but you can only give one --platform and say --load instead for testing; but then you can't push that same image).

@theAkito
Copy link
Collaborator

theAkito commented Oct 8, 2023

I was very surprised to notice the hard way, this project does not just naturally, self-explanatorily, use buildx to simply build multi-arch builds.

If this isn't already handled, I am more than willing to provide multi-arch builds to the related GitHub workflow...

@theAkito
Copy link
Collaborator

Hereby I kindly present you my multi-arch image.

https://github.com/theAkito/docker-nim

https://hub.docker.com/r/akito13/nim

It supports the following architectures.

linux/ppc64le
linux/arm/v7
linux/arm64/v8
linux/amd64

@moigagoo
Copy link
Owner

moigagoo commented Nov 9, 2023

@theAkito

I was very surprised to notice the hard way, this project does not just naturally, self-explanatorily, use buildx to simply build multi-arch builds.

Sorry, I didn't know what buildx was at the time when those images were composed. I'm learning about it now, thanks.

I really think the images in this repo didn't age well. First, they're still unofficial. Second, they're not automated to build in sync with new releases, I build and push new images manually.

If your images are better than these, please feel free to take over.

@moigagoo
Copy link
Owner

moigagoo commented Nov 9, 2023

@theAkito I think you should chime in in this thread and propose your solution for the official Docker images: nim-lang/RFCs#515

@theAkito
Copy link
Collaborator

theAkito commented Nov 9, 2023

I really think the images in this repo didn't age well. First, they're still unofficial. Second, they're not automated to build in sync with new releases, I build and push new images manually.

If your images are better than these, please feel free to take over.

Sure, I'd be willing to take over!

@theAkito I think you should chime in in this thread and propose your solution for the official Docker images: nim-lang/RFCs#515

Thanks for this, didn't know about this issue. Will comment now...

@moigagoo
Copy link
Owner

moigagoo commented Nov 9, 2023

@theAkito

Sure, I'd be willing to take over!

I've invited you as a contributor to this repo. I'll grant you full permissions to the repo after you accept the invitation.

@theAkito
Copy link
Collaborator

theAkito commented Nov 9, 2023

I've invited you as a contributor to this repo. I'll grant you full permissions to the repo after you accept the invitation.

Thanks! Accepted the invitation. However, I think I would first wait for someone to respond at the RFC first, to get to an agreement what the next steps would be, before changing anything.

Although, when reading through the original post in the RFC, it's clear, that the new image will either be hosted on nim-lang or docker-library.

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

3 participants