Closed endonym closed 1 year ago
Any news on support for MacBook Pros with M1 chips? at least for non-production cases? I think unit testing your code locally (via docker run
), then pushing Intel-based images to your container registry for use in your Kube of choice, would be a pretty common use case, especially now that lots of older MacBooks are getting replaced with M1s. Though I don't have one yet, a colleague on our Cloud Journey Optimization Team here in Kyndryl hit this, and I had to help him figure out some workarounds (he was trying to build one of my Stock Trader microservices)
To document what we figured out:
I had him switch from the multi-arch image to hard-coding that he wanted the Intel image. This meant editing the Dockerfile and changing the tag in the FROM line from 21.0.0.9-full-java11-openj9-ubi
to 21.0.0.9-full-java11-openj9-ubi-amd64
(btw, it's odd we say AMD for Intel, rather than something generic like x86). Otherwise the docker pull would fail, as it would look for an arch image that his laptop could handle and would report "sorry, no arm64".
Next we got failures in configure.sh
. By default, it wants to create a "shared class cache", which requires starting the server during the docker build. this failed with a cryptic message, but it seemed to be saying it couldn't launch Liberty in that Intel image being built on his arm64 device. We had to add an ARG OPENJ9_SCC=false
to the Dockerfile to suppress this (which yes, might make the server take an extra second or so to launch, as it now will have to do this just-in-time as the pod starts).
We now had an Intel image built, though of course he couldn't run it on his M1. But it was fine to push that to his image registry (GCR) and have his Kube (GKE) pull that image, by updating the CR yaml that my operator handles to point to that newly built Intel-based image, which ran fine on his cluster with Intel-based worker nodes.
This was the best workaround I could figure out, given that Liberty doesn't yet publish images that a MacBook Pro M1 can handle.
@jwalcorn Since the base Semeru images (at least the Ubuntu ones) are already published with arm64 versions you can just use the build scripts from this repo to build your own arm64 image of OpenLiberty. I think that's much better workaround than what you are doing.
The official images already are available for multiple architectures, so adding arm64
should be trivial, shouldn't it?
Hello! I have the similar need. Is it already in progress? Is there any plan to provide it?
I managed to locally build and run an ARM image. I will submit a PR to hopefully get the ARM build in the official image, until then you can build it locally on your ARM machine.
export OWNER=<YOUR_GITHUB_USERNAME_OR_ORG>
gh repo clone OpenLiberty/ci.docker
cd ci.docker/build
# Replace with the flavor you need, full should at least work in most use cases
./build.sh --dir=../releases/latest/full --dockerfile=Dockerfile.ubuntu.openjdk8 --tag=ghcr.io/$OWNER/open-liberty:full
Optionally push to GHCR to be able to pull in production:
docker login ghcr.io
docker push ghcr.io/$OWNER/open-liberty:full
Dockerfile:
# Instead of FROM docker.io/open-liberty:full
FROM ghcr.io/$OWNER/open-liberty:full
...
Steps to set up your own cross-platform fork that works on both AMD64 and ARM64:
ghcr.io/USERNAME_OR_ORG/open-liberty:full
as image in your Dockerfile, docker-compose.yml or Kubernetes config.Thank you all for the suggestions and interest in the arm64 images. We do intend to support it. Testing for Liberty runtime on ARM64 is not complete yet. Once that completes, we'll proceed to create the container images (and do some testing). Unofficially, they are expected to be available in 2Q/3Q. cc @NottyCode
@leochr any update ?
So this issue is now coming to light more because IBM is now shipping the new M1/M2 laptops to developers. This means any person using a new Mac is going to hit issues with our Docker images. There is a work around to get the image downloaded but it then fails in Kubernetes environments with the JVM falling over. Do we have an ETA for this being resolved as all our Kubernetes guides on openliberty.io will no longer work?
@gkwan-ibm & @ReeceNana FYI ^^^
I noticed the workaround GitHub action to build & host your own ARM64+AMD64 image gave a 404. So I updated the link and added more instructions in case anyone still needs it: https://github.com/OpenLiberty/ci.docker/issues/241#issuecomment-1035123075
Any updates regarding this topic?
We're also very interested in leveraging ARM based open liberty image. We have an active effort to migrate hundreds of our Java EE workloads to containerized open liberty deployment, and a lot of our developers are getting M1 mac book pros. Please provide an update on whether there's an ETA for a resolution to this.
@leochr I see https://github.com/ibmruntimes/Semeru-Runtimes/issues/33 got closed a few weeks ago...can we expect an openliberty aarch64 / arm64 image anytime soon?
@jakub-pomykala FYI
Can someone explain to me the hold up? If a PR was accepted in Februari and all that was left to do was test them, surely enough time has passed since?
After completing the extensive platform testing, the Liberty runtime (non-containerized) claimed support for ARM (sometime in October).
The build platform that's currently used to build the UBI-based Liberty images doesn't support linux/arm64, so we are exploring a few options. ~In parallel, we'll look into publishing the Ubuntu-based Liberty images with support for linux/arm64 to Docker Hub (built on Docker's infrastructure).~ Before updating Ubuntu-images, we need to build and test the images internally, which we are unable to do until the build platform supports arm64. Build platform team is working on adding this support.
@leochr Is there any update on this? It would be amazing to be able to build a liberty container without having to build from source
@bjpirt Build platform support for arm64 should be added soon and we anticipate the Liberty images for linux/arm64 to be available in 2Q. If everything goes well, it might be available in May.
Any status since May is almost over? buildx should have solved this long ago
in my understanding, ol docker image already support arm64 recently
@gkwan-ibm thank you -- at the URL https://hub.docker.com/_/open-liberty I see the following:
Thanks for those who worked on this to add support!
I'm a little confused at the separate arm64 image repo. I'm not a Docker expert, but thought the additional architectures would be additional options for images under the main image repo. Could someone help clarify for me?
Thanks again!
@l3ender Both are essentially the same image. DockerHub just indexes the same image under both repos
Taking 23.0.0.3-kernel-slim-java17-openj9
as an example, both of these repos list the same image for arm64 (see the digest value)
Suggest just using the former repo which is the main/official Open Liberty repo for Ubuntu images: https://hub.docker.com/_/open-liberty
UBI images are available from both Docker Hub and icr.io. Our recommendation is to use icr.io (no rate limits, maintained by IBM). They are listed here: https://ibm.biz/ol-images-icr
Delivered. Note that IBM Java-based images don't support arm64, hence Liberty images with IBM Java are not available for arm64
using
docker pull open-liberty
with an Apple M1 chip results in a message of;
no matching manifest for linux/arm64/v8 in the manifest list entries