openjdk-docker
openjdk-docker copied to clipboard
Enhancement: Alpine builds to support multiple architectures
Since OpenWhisk has adopted the AdoptOpenJDK 8 Alpine images as the basis for its core images, I've become interested in making it compatible with not amd64 architectures. The sticking point, it seems, is making glibc, libgcc, and zlib available for ppc64le, aarch64, and s390x architectures. I see two options:
- Create a dump for tarballs of those libraries. Given their fairly infrequent release schedule this is probably the best option. (This could potentially be automated and brought into the AdoptOpenJDK farm).
- Use a multi-stage build in the core Dockerfile (yes, I know it's script-generated) to build the libraries as we go.
For the moment, I'm going with approach 1. This issue is for information and tracking purposes.
@jonpspri Your contributions are welcome ! A couple of points
- I have used the ArchLinux distro for the x86_64 zlib/libgcc/libstdc++ packages and glibc that is maintained by sgerrand. Some of these are not available on all arches at this time. Do you have them all mapped out currently ?
- Ideally pulling in the files from the distro pages would be best as that would be least overhead in terms of maintaining them (and also prevent any legal issues from redistributing etc)
Look forward to your PR !
@dinogun I'm using the sgerrand work as the starting point for my efforts.
I've gotten sgerrand/docker-glibc-builder to work on all architectures (once bumped to the latest OS); I'm moving on to the libgcc libstdc++ and zlib now. Once I'm sure all builds are working, I can integrate them as a distro-pull based multi-stage build. It may be taxing on the farm, but should minimize maintenance and redistribution issues.
So I expect this will be a multi-PR effort. OTOH, it's moving smoothly so far.
PR filed for commentary. Some documentation still needed.
Were we waiting to put any Alpine images in Docker Hub until multi-architecture stuff is worked out? I'm confused by the status of getting Alpine images because I see code here in master, but don't see any Alpine images in Docker Hub.
@keeganwitt, there are slim images in the AdoptOpenJDK namespace.
Github: https://github.com/AdoptOpenJDK/openjdk-docker/blob/master/12/jdk/alpine/Dockerfile.hotspot.releases.slim Docker: https://hub.docker.com/r/adoptopenjdk/openjdk12
you are looking in the officialImages Namespace
@jonpspri would be great if you could check the reviewed PR :) I'm also interested into up-to-date Alpine OpenJDK8 aarch64/armhf images.
@stbischof yeah; @keeganwitt is deliberately asking about official images; because other official
projects (e.g gradle-docker
) must extend from official
images; so there is additional utility in getting the alpine and slim images into official if they are indeed supported. It's also worth noting that the AdoptOpenJDK namespace now has out-of-date images; i.e no 11.0.4
or 12.0.2
:-/
Now that the musl port has been merged into jdk16 we can start producing musl based builds for several architectures. This should unblock this issue