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

ARM64 Support #26

Open
microsby0 opened this issue Feb 17, 2022 · 17 comments
Open

ARM64 Support #26

microsby0 opened this issue Feb 17, 2022 · 17 comments

Comments

@microsby0
Copy link

Need support for ARM64. Current error:

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
@rdmueller
Copy link
Member

hm. I guess that is a problem with the java binaries.

What did you do so that I can reproduce the problem?

@microsby0
Copy link
Author

microsby0 commented Feb 17, 2022

Run the top example script from the README on an M1 mac.

docker run --rm -it --entrypoint /bin/bash -v ${PWD}:/project rdmueller/doctoolchain:rc-1.4.0 \
-c "doctoolchain . $1 $2 $3 $4 $5 $6 $7 $8 $9 -PinputPath=src/main/asciidoc -PmainConfigFile=config/docToolchain.groovy && exit"

Its a brand new machine for me so it actually took me some time to understand exactly where the issue was. M1 setup is a whole new world 😆

@rdmueller
Copy link
Member

argh. I guess the binary image is not an arm one. But docToolchain runs on M1 machines, I once tested it.

You might want to check out this tutorial: http://doctoolchain.org/docToolchain/v2.0.x/020_tutorial/010_Install.html

It might be that you have to force it to locally install docToolchain by using once the "local" option as first parameter like this:

cd <your project>
curl -Lo dtcw doctoolchain.github.io/dtcw
chmod +x dtcw
./dtcw local tasks

this will install it locally to you home folder (you can just delete the .doctoolchain folder if you want to uninstall it).
Make sure that you have java installed before you run this (version between 8 and 14).

regarding the docker image for M1 arm architecture - someone with an M1 machine has to figure out how to do it ;-)

@microsby0
Copy link
Author

Makes sense, I'll give that work around a try and leave this issue up and hope someone with more knowledge than me comes along.

@Morl99
Copy link

Morl99 commented Mar 10, 2022

I would also like this.

In order to build multi-architecture docker images, the most important thing is, that the base image also supports the relevant platforms. This is an issue with the current openjdk 13 alpine based image. I don't know of any official alpine based java image that supports arm atm. If you are willing to migrate to the debian variant of the image and update to Java 17, you could use this image.

I would be happy to set this up with you, once you upgraded the base image to a multi-platform image, we could leave this issue open until then and create a separate issue for upgrading to Java 17 and moving to debian?

@rdmueller
Copy link
Member

Great. Thanx for your support.
Debian shouldn't be a big issue.
But jdk17 is one. But it is also already next on the roadmap

@rdmueller
Copy link
Member

@Morl99 I guess I would need an M1 chip to build such an image, wouldn't I?

anyway, can't we use a debian base image and install JDK11 or JDK14 through sdkman?

@Morl99
Copy link

Morl99 commented Mar 10, 2022

Or you use GitHub Actions to build all of your images? (:

And sure, you could craft a java image yourself, but why would you do that? Is there a good reason to stick with a no longer supported java release?

@rdmueller
Copy link
Member

Isn't jdk11 still a supported lts?

Yeah, GitHub actions would be great for the build. Do you have a bit time?

Why stick to the old version? Because in this case, an upgrade is not too easy. Too many dependencies and breaking changes

@Morl99
Copy link

Morl99 commented Mar 11, 2022

11 is, but 14 (that you use here) is not.

Sure, we can work on this together, cannot be that hard to figure out ;)

@Morl99
Copy link

Morl99 commented Mar 12, 2022

Most of what we would need can be found here: Build and push docker image GitHub action

We could spice it up with a semantic release that automatically calculates the next version based on conventional commits, if you are up to it. Basically this turns every commit on master into an automated release. There are a couple of GitHub Actions out there that achieve this, we would need to look into which one is best suited for this project.

@m-gora
Copy link

m-gora commented Mar 23, 2022

I might also be able to help out here. The current image is super slow on Apple Silicon.

@nicolaimainiero
Copy link

You can find a working example using github workflow in my repository : https://github.com/nicolaimainiero/docker-image feel freee to copy what you need.

@rdmueller
Copy link
Member

does anybody know if there is somewhere a virtual M1 available so that I can remotely test things like that?

@nicolaimainiero
Copy link

I think a Raspberry Pi 4 should be sufficient to test the container on the ARM64 architecture. Possibly AWS Gravitron (https://aws.amazon.com/de/ec2/graviton/) is also an option.

@m-gora
Copy link

m-gora commented Apr 11, 2022

I tried to get something running, unfortunately it is a bit complicated and I stumbled upon countless problems.

There's a Docker blogpost how to create multiarch images: https://www.docker.com/blog/multi-arch-build-and-images-the-simple-way/

I followed this blogpost by setting up docker buildx on my mac.
However the alpine based openjdk base image does not support arm64, so i tried switching to temurin instead.
Then I discovered that temurin does not use alpine as base image but some debian variant, so i had to switch out all the apk related commands.

I opted for a quick solution here, but this was just not it. A lot more research is needed here (or a multi-layer build process).

@rdmueller
Copy link
Member

I would like to follow up on this issue.
We now already have a github action with buildx setup. And it deploys to docker-hub.
I think we are not so far away from a solution yet...

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

No branches or pull requests

5 participants