openjdk-docker icon indicating copy to clipboard operation
openjdk-docker copied to clipboard

Enhancement: Alpine builds to support multiple architectures

Open jonpspri opened this issue 5 years ago • 8 comments

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:

  1. 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).
  2. 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 avatar Dec 07 '18 11:12 jonpspri

@jonpspri Your contributions are welcome ! A couple of points

  1. 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 ?
  2. 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 avatar Dec 07 '18 13:12 dinogun

@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.

jonpspri avatar Dec 07 '18 15:12 jonpspri

PR filed for commentary. Some documentation still needed.

jonpspri avatar Dec 11 '18 21:12 jonpspri

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 avatar Jul 18 '19 02:07 keeganwitt

@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

stbischof avatar Jul 23 '19 12:07 stbischof

@jonpspri would be great if you could check the reviewed PR :) I'm also interested into up-to-date Alpine OpenJDK8 aarch64/armhf images.

gregorkistler avatar Jul 28 '19 07:07 gregorkistler

@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 :-/

chadlwilson avatar Aug 04 '19 06:08 chadlwilson

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

gdams avatar Mar 18 '21 11:03 gdams