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

Build Java 11 Alpine #211

Closed
ST-DDT opened this issue Jul 2, 2018 · 24 comments
Closed

Build Java 11 Alpine #211

ST-DDT opened this issue Jul 2, 2018 · 24 comments
Labels
Request Request for image modification or feature

Comments

@ST-DDT
Copy link

ST-DDT commented Jul 2, 2018

On the java page there is a alpine compatible build for Java 11.

http://jdk.java.net/11/
https://download.java.net/java/early_access/alpine/19/binaries/openjdk-11-ea+19_linux-x64-musl_bin.tar.gz

Could you please build a docker image for that, so I could start testing Java 11 before Java 8 goes EOL this year?

Or is it required to appear in the official repository that was linked in some other issues https://pkgs.alpinelinux.org/packages?name=openjdk*&branch=edge ?

@wglambert wglambert added the Request Request for image modification or feature label Jul 2, 2018
@keckelt
Copy link

keckelt commented Aug 1, 2018

I tinkered a bit today and wrote a Dockerfile with alpine 3.8 and the OpenJDK build: https://github.com/keckelt/openjdk11-alpine

It's my second Dockerfile, so I'm sure it could be improved. But it works.

@timbru31
Copy link

timbru31 commented Aug 1, 2018

@keckelt - nice. One tip: delete the src.zip archive that's included to reduce the size (see e.g. here https://github.com/timbru31/docker-alpine-java-maven/blob/master/Dockerfile#L23)

@tianon
Copy link
Member

tianon commented Aug 2, 2018

Isn't src.zip useful to include for many use cases? (Especially since this is already the full JDK, so not exactly "slim".)

For context, the current openjdk:11-jdk image contains src.zip:

$ docker run --rm openjdk:11-jdk find /usr -name src.zip
/usr/lib/jvm/java-11-openjdk-amd64/src.zip

@tianon
Copy link
Member

tianon commented Aug 2, 2018

I'm a little bit concerned that this will be a divergence from our previous Alpine images (and will mean we can only support amd64), but given that https://bugs.alpinelinux.org/issues/8089 is still open and unresolved 9 months and 2 releases later, I think moving forward with the upstream-provided binaires for Alpine probably makes sense.

@tianon
Copy link
Member

tianon commented Aug 2, 2018

(It looks like we could even add the Early Access builds of OpenJDK 12 via this method, which would get the jump on Debian too.)

@tianon
Copy link
Member

tianon commented Aug 23, 2018

This is related to #212 too 👍

@nafeger
Copy link

nafeger commented Oct 3, 2018

The openjdk build for alpine was removed for jdk 11, there is only an EAP for jdk12. Should the default download for linux jdk work on a stock alpine image?

See this note: http://jdk.java.net/11/

The linked docker file does still work, however, it appears to not be a supported version ala this info

@tianon
Copy link
Member

tianon commented Oct 3, 2018

Yeah, see #212 (comment) and #235 (comment):

Yeah, the alpine port is not in a supported release, since it's not in the mainline code base, so it's only available as early access builds of OpenJDK Project Portola http://openjdk.java.net/projects/portola.

It works, but at this stage it basically needs community contributors to help maintain it and get it into mainline - see https://twitter.com/MikaelVidstedt/status/984920426655526912 for details. Interested contributors should drop by portola-dev to discuss specifics.

@nafeger
Copy link

nafeger commented Oct 3, 2018

Yeah, see #212 (comment) and #235 (comment):

Yeah, the alpine port is not in a supported release, since it's not in the mainline code base, so it's only available as early access builds of OpenJDK Project Portola http://openjdk.java.net/projects/portola.
It works, but at this stage it basically needs community contributors to help maintain it and get it into mainline - see https://twitter.com/MikaelVidstedt/status/984920426655526912 for details. Interested contributors should drop by portola-dev to discuss specifics.

Thanks for the update, totally missed those comments.

@ngrigoriev
Copy link

Please correct me if I am wrong, but going forward - which OpenJDK build will be used by Alpine for the official images? Oracle will stop making OpenJDK builds in 5 months. Portola does not seem to make any statements about it. I am trying to find a stable source of OpenJDK 11 images going forward (beyond the timeframe of 5 months), this is why I am looking for an answer.

@tianon
Copy link
Member

tianon commented Oct 10, 2018

Please correct me if I am wrong, but going forward - which OpenJDK build will be used by Alpine for the official images?

Right now, the official images have no plans to support Alpine for OpenJDK 11 -- the Alpine project is not producing usable or timely builds since OpenJDK 8 (https://bugs.alpinelinux.org/issues/8089), and Project Portola (as noted above) does not have the necessary manpower to be fully supported by Oracle, so there's really nothing we can do there except recommend that interested folks go get involved with Project Portola.

For OpenJDK 12 EA builds, we currently have Alpine builds courtesy of Portola, but those might go away with 12's GA if Portola doesn't get enough support before then.

@michaelbannister
Copy link

Worth having a look at https://hub.docker.com/u/adoptopenjdk/

@ST-DDT
Copy link
Author

ST-DDT commented Oct 24, 2018

@michaelbannister Are there any slim builds for that repo? Also I'm missing the tags for "just java 11" what is jdk-11.28) and the distinction between jre and jdk.

The images are smaller that this repository's non-slim ones though. Is there less of something in there?

@michaelbannister
Copy link

@ST-DDT I should've made clear that I haven't yet tried using these images (but I've been aware of the AdoptOpenJDK efforts for a few months). I only just found out they were producing Alpine images.
If you look at the tags for adoptopenjdk/openjdk11 you'll see they include jdk-11.28-alpine, alpine (I'm guessing that's equivalent of latest jdk-11)

See the readme for more detail, including the fact that:

The Alpine Linux and the slim images are not yet TCK certified.
https://github.com/AdoptOpenJDK/openjdk-docker#supported-builds-and-build-types

@robilad
Copy link

robilad commented Nov 13, 2018

A bit more on Portola status is available here: https://mjg123.github.io/2018/11/05/alpine-jdk11-images.html

" In order to move Alpine to “supported” and have GA releases of Portola Oracle is looking for people to be actively interested: contribute to the extent of your abilities - code and tests are welcome but so is being active and public about your support - say if you find any issues, and say too if everything worked fine. If containers are critical to your company, saying that you would be interested in a Java SE Subscription if Alpine were supported would go a long way, too."

@p-bakker
Copy link

Azul seems to have gotten OpenJDK going on Alpine and passes the full OpenJDK TCK Java compliance suite, see https://www.azul.com/downloads/zulu/zulu-download-alpine/

How does this factor into this issue report?

@nafeger
Copy link

nafeger commented Dec 17, 2018 via email

@yosifkit
Copy link
Member

Created an issue around updating openjdk versions: #272.

@alexellis
Copy link

Is there an OpenJDK 11 image for Alpine Linux?

@keckelt
Copy link

keckelt commented Jan 28, 2020

No. From java.net:

The Alpine Linux build previously available on this page was removed as of JDK 11 GA. It’s not production-ready because it hasn’t been tested thoroughly enough to be considered a GA build.

The one I used before OpenJDK12 was available with that the last build and can be found here: https://github.com/keckelt/openjdk11-alpine/tree/c604a108eea124d5cc3c26ade1ac2a1333422816

But i would recommend using OpenJDK12: https://pkgs.alpinelinux.org/packages?name=openjdk12&branch=edge


Edit: Seems like there is also an Openjdk11 package for alpine https://pkgs.alpinelinux.org/packages?name=openjdk11*&branch=v3.10&arch=x86_64

I've updated the Dockerfile: https://github.com/keckelt/openjdk11-alpine/blob/master/Dockerfile

@delabassee
Copy link

But i would recommend using OpenJDK12: https://pkgs.alpinelinux.org/packages?name=openjdk12&branch=edge

I wouldn't recommend 12 as it isn't supported anymore and that particular Alpine build is ~18 months old.
If you really want a recent Alpine build, grab the 14 one at https://jdk.java.net/14/ with the usual caveats (EA, don't try this at home, ...).

@alexellis
Copy link

Thank you everybody for the input. Perhaps what I need is an alpine given this information. What's the next smallest version that I could be looking at for prod? Debian slim seems to be > 450mb for the JDK.

@col-panic
Copy link

I use https://hub.docker.com/r/adoptopenjdk/openjdk11 resp adoptopenjdk/openjdk11:alpine-jre-nightly and am quite satisfied with it.

@delabassee
Copy link

@alexellis to avoid the jumbo size on Debian, you need to strip-out the debug info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Request Request for image modification or feature
Projects
None yet
Development

No branches or pull requests