Docker alpine + oracle java: cannot find java

后端 未结 2 1622
醉话见心
醉话见心 2020-12-17 17:23

I\'ve been trying to create an alpine-based docker image with Oracle Java (rather than openjdk). I have been specifically asked to create our own image here.

This i

相关标签:
2条回答
  • 2020-12-17 17:35

    You cannot achieve what you want.

    Alpine Linux uses MUSL as a Standard C library.

    Oracle's Java for linux depends on GNU Standard C library (gclib).

    There is theoretical way, but it is not as trivial as you think.

    See this link

    You can find examples of Alpine images running with OracleJDK here.This example adds the missing Standard GNU C library.

    Here is a bit more detailed info and official stance from Oracle on the topic

    the JDK source code has not yet been ported to Alpine Linux, or more specifically, the musl C library. That is, it turns out that the thing about Alpine Linux that sticks out/is different from a JDK source code perspective is the C library.

    In short use official Oracle Java Docker image

    0 讨论(0)
  • 2020-12-17 17:45

    In case anyone needs fresh version of JDK I maintain Alpine Oracle JDK images https://hub.docker.com/repository/docker/expert/docker-java-minimal/

    Sources https://github.com/unoexperto/docker-java-minimal/

    0 讨论(0)
提交回复
热议问题