-
-
Notifications
You must be signed in to change notification settings - Fork 244
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 multi-arch (amd64, arm/v7, arm64/v8, ppc64le, s390x) #90
Conversation
- openjdk:8-slim only supports amd64 - adoptopenjdk:latest supports amd64, arm64, arm/v7, ppc64le, s390x - TODO: This includes a bump from jre 8 to jre 11. What testing is required? - TODO: gosu doesn't work for buildx / qemu-user arm emulation so I switched to su command. Are there issues with this? I don't think gosu is needed for a simple switch user command Signed-off-by: Jon Stelly <967068+jonstelly@users.noreply.github.com>
3.4.14/Dockerfile
Outdated
@@ -1,4 +1,4 @@ | |||
FROM openjdk:8-jre-slim | |||
FROM adoptopenjdk:latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should use tagged release to provide reproducible images
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch, thanks. I pinned to 8u232-b09-jre-hotspot (commit: c38c301) which also reduced image size by ~120MB per platform since their latest tag is the jdk instead of the jre.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, we're sticking wit jre 8, right? I think it's better to switch to jre 11 later if there any benefits to do so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any arm images using jre 8 from adoptopenjdk:
https://hub.docker.com/_/adoptopenjdk?tab=tags&page=1&name=-b08-
They do have tar.gz files we could download and extract:
https://adoptopenjdk.net/releases.html
We could also keep things as they are for the zookeeper:latest tag but create another tag, maybe jre11
and/or jre13
and only those tags would be available for arm32/64/etc...?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://hub.docker.com/r/adoptopenjdk/openjdk8 different repo for jdk8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thanks. I don't see a stable tag from that repo that is a manifest covering amd64/arm64/....
https://hub.docker.com/r/adoptopenjdk/openjdk8/tags?page=1&name=debianslim-jre
The debianslim-jre tag isn't available for arm64, but their debianslim-jre-nightly is.
Signed-off-by: Jon Stelly <967068+jonstelly@users.noreply.github.com>
Hey @jonstelly thanks for you interest in contributing to Zookeper Docker image!
Here is an explanation why
Usually I perform smoke testing manually by executing sample instructions from the documentation: https://github.com/docker-library/docs/tree/master/zookeeper |
re: gosu - Related to the code review conversation, I guess there are a couple things we need to figure out. Mainly, I don't see any openjdk:8 images for arm64. So the options look like:
Also, if moving to a different jre or base seems risky, we could always keep the current zookeeper:latest tag pointing to the same openjdk jre 8 it uses today, and add one or more new tags and only the new tag(s) would be available for other architectures.
Whether we want to support multiple tags like that or not, it doesn't seem like jre 8 + staying on openjdk as the base image is an option that can support these other architectures. Personally, basing off of |
Adding more tags would require more time to maintain which I don't have unfortunately.
I don't think we should go that way. I'd rather keep installing java out of the image scope and rely on well maintained java images. My main concern about switching to AdoptOpenJDK is that I can't find any info about whether or not the HotSpot VM is supported by the upstream. I'm not experienced in Java at all so I don't know how risky is this and not ready to debug VM related issues if any come up. |
AdoptOpenJDK by default comes with HS, but you can optionally change it to J9, it's right on their homepage https://adoptopenjdk.net/
AdoptOpenJDK is one of the top players in post java8. Oracle and OpenJDK don't provide very portable builds, best ones to relay now (java8 LTS and java8+) on are Amazon Corretto and AdoptOpenJDK. RedHat OpenJDK also plays a big role, but they got quite late to the party when AOJDK and Corretto had established their positions |
Sorry, by the upstream I meant Zookeeper. |
Seems like they use hotspot metrics in exporter https://github.com/apache/zookeeper/blob/1c5d135d74f16275876c024401dc2de92909b20a/zookeeper-metrics-providers/zookeeper-prometheus-metrics/pom.xml |
Given the discussion here and completely understandable reluctance to make sweeping JDK changes or take on more complexity, I'm now leaning towards just maintaining my images. I'll keep them based off of this repo and pick up updates as needed. And if anything changes in the future and you'd like to try and merge things, I'll be happy to coordinate with you and submit a new PR. Thanks for the discussion. Not being a Java guy, it provided some good context about the current state of JDKs, etc... Feel free to close this PR if/when you'd like. |
Closing it because the PR seems to be inactive for quite some time now. |
This switches to the adoptopenjdk base image and uses their latest tag to support all the architectures listed above. This should resolve #87, and not mentioned in #87, the current zookeeper tags don't even support arm64, only amd64 because the base openjdk 8-slim tag only supports amd64.
I've built and published the result of this build to the docker hub as kymeric/zookeeper. The sequence to build using docker and buildx:
BUILD
requirements
steps
docker buildx create --name mp --platform=linux/amd64,linux/arm64/v8,linux/arm/v7,linux/ppc64le,linux/s390x --use docker buildx inspect mp --bootstrap docker buildx build --platform=linux/amd64,linux/arm64/v8,linux/arm/v7,linux/ppc64le,linux/s390x -t kymeric/zookeeper:latest --push .
TESTING
kubernetes
I'm testing on arm64 and amd64 in Kubernetes (hybrid kubernetes cluster) by deploying the kafka and zookeeper charts with this command (also uses my custom build of cp-kafka for arm64):
I'll be testing this over the next few weeks but wanted to start the pull request now to get feedback.
Notes
TODO