-
-
Notifications
You must be signed in to change notification settings - Fork 242
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
Support for ARM64 for docker image #1180
Comments
It's probably possible :) https://medium.com/swlh/using-github-actions-to-build-arm-based-docker-images-413a8d498ee But will take some time if I have to do it myself because of my little available time these days ^^ We could have "mirror" images with Do you have Github Actions knownledge ? I would glady accept a PR :) |
Today I tried to build an arm64 docker image. The solution to build multiple docker images (same name, but different CPU architectures combined) is to use buildx. docker buildx create --use Then, replacing docker build --no-cache --build-arg "BUILD_DATE=${BUILD_DATE}" --build-arg "BUILD_REVISION=${BUILD_REVISION}" --build-arg "BUILD_VERSION=${BUILD_VERSION}" -t "${CONTAINER_URL}:${IMAGE_VERSION}" -f "${DOCKERFILE_PATH}" . 2>&1 with docker buildx build --platform linux/amd64,linux/arm64 --no-cache --build-arg "BUILD_DATE=${BUILD_DATE}" --build-arg "BUILD_REVISION=${BUILD_REVISION}" --build-arg "BUILD_VERSION=${BUILD_VERSION}" -t "${CONTAINER_URL}:${IMAGE_VERSION}" -f "${DOCKERFILE_PATH}" . 2>&1 should do the work (replacing all the places with build by buildx build and platforms. However, there is some prep work to make everything work. I also tried building the Dockerfile locally on a Raspberry Pi 4, but it failed when it came time to pull So, I'll try to come back with a TODO list of linters to fix the install to get a building image, and one day we could talk about actual failing linters. In the meantime, some prep work to integrate having different URL installers should be done. Most of the Docker tools are ok, especially when they target only alpine, or many arch are available. |
Thank a lot for your analysis :) About not compliant linters, we could eventually flag them in descriptors so they are simply not added within arm64 images Story to be continued... :) |
I just hope that to start, at least one flavour would have all linters working... We'll see :) |
This issue has been automatically marked as stale because it has not had recent activity. If you think this issue should stay open, please remove the |
I'd like to keep it as a milestone task, but it'll be over the next two months though... I'm still thinking it out regularly |
This issue has been automatically marked as stale because it has not had recent activity. If you think this issue should stay open, please remove the |
really needed |
@natpicone What linters or flavours do you use in priority? It is not a simple task to have MegaLinter on arm, since we would have to ask for changes in many of the included projets. |
I'm currently using ruby and javascript ones; running them on my M1 is a pain because sometimes docker x86 emulation crashes or takes a lot of time. |
This issue has been automatically marked as stale because it has not had recent activity. If you think this issue should stay open, please remove the |
For some reason the bot didn’t honor the nostale label, so I removed the stale label manually. |
This issue has been automatically marked as stale because it has not had recent activity. If you think this issue should stay open, please remove the |
I have started working on it: #1553 |
This issue has been automatically marked as stale because it has not had recent activity. If you think this issue should stay open, please remove the |
No stale, the other PR is not finished |
This issue has been automatically marked as stale because it has not had recent activity. If you think this issue should stay open, please remove the |
@nvuillam any progress on this one? |
@jokay there was a PR which was quite progressing, but other maintainers are following the topic and probably could tell you more :) |
Well, the truth is quite scattered... I started with #2273 but I found several blocks.... @waterfoul followed with #2549 (which I really miss what was trying to be achieved here) but has not given signs of life for some time and it's a pity because it looks like good progress. And finally @echoix is with #3193 which allows to unlock some problem. |
The summary seems to be "Someday in a MegaLinter v8" ^^ |
@bdovaz it would allow to run a something like https://github.com/echoix/megalinter/pull/28/files#diff-c40ecec00fa976e23241a7188bb7ca5e905d288775c1286f81dd85d1e07ba2f0R41-R48 (and the changes that I made under that to push to that) But we will need to fight against the disk space, since at one point, when pushing the built image, will have the space used by docker buildx plus the space used by that local registry that it is copied to. Multi-platform image means that we will have 2x the space used. (4x the size I'm of the image). I can image a way that we can lower the max disk space used to 3x the image size, by building one after the other and cleaning buildx in between, but still. That will be an issue to figure out. But at least it should allow us to advance a bit more. Maybe we could start by merging #2549 into #2273, (without having everything working yet), apply the changes that use the metadata action, then we could add the local registry and really start building and work around the failures of missing space or builds too long/too big. |
@echoix I think you misunderstood me, I was referring to #2549 which is the one I don't know what I was trying to solve and it's half-finished and @waterfoul gives no sign. And I don't know what improves / solves over my PR (#2273). |
#2549 had some pretty nice optimizations, Dockerfile organization and patterns that would be a shame to loose. It solved multiple problems (that it had) when he was doing it. I know it might be impossible to do a real "merge" because of how fast the repo changes, but the ideas are still clearly there. |
Hi, I just wanted to chime in to note that this issue might be a little more relevant now, due to the release of ARM64 GitHub Actions runners. |
Looks like it didn't happen? 🫣 |
@javydekoning it did not happen ^^ If you want to invest time on it with us you are welcome to help the "Someday in a MegaLinter v9" happen 😊 |
Currently only see linux/amd64 on https://hub.docker.com/r/megalinter/megalinter/tags
It would be amazing to have arm64 also
Thanks
The text was updated successfully, but these errors were encountered: