GithubHelp home page GithubHelp logo

docker-hub-frolvlad / docker-alpine-java Goto Github PK

View Code? Open in Web Editor NEW
343.0 25.0 137.0 49 KB

Small Docker image with Java 8+ runtime (JRE ~119MB) and devkit (JDK ~167MB)

Home Page: https://hub.docker.com/r/frolvlad/alpine-java/

License: MIT License

Dockerfile 100.00%
docker-image java java-8

docker-alpine-java's Introduction

Docker Stars Docker Pulls

Java Docker image

This image is based on Alpine Linux image, which is only a 5MB image, and contains Java runtime (JRE) and Java development kit (JDK) conveniently packaged into separate Docker tags.

DEPRECATION DUE TO ORACLE JAVA LICENSING CHANGE

Thank you to everyone using images derived from this repo, to everyone who inspired and contributed. After April 2019, due to Oracle Java licensing changes, this repo is deprecated, and is now for reference only. No new builds will be published to frolvlad/alpine-java repo on Docker Hub from this Github repo.

As announced, Java licensing changed, and starting April 2019 commercial usage of Oracle Java required subscription. In other words, switch to OpenJDK, or use older versions of Oracle Java (for reference, pre-built images are available on Docker Hub)

Official OpenJDK images receive regular updates, and are available at https://hub.docker.com/_/openjdk, including 8-jre-alpine (85MB), 8-jdk-alpine (105MB), 8-jre-slim (204MB), 8-jdk-slim (243MB), 8u212-jre-slim (204MB), 8u212-jdk-slim (243MB), etc..

For more details about Oracle Java Licensing, checkout this article: https://medium.com/@javachampions/java-is-still-free-2-0-0-6b9aa8d6d244

TL;DR

Oracle JDK 8 is going through the “End of Public Updates” process, which means the April 2019 update will restrict commercial use. However, since Java SE 9, Oracle is also providing Oracle OpenJDK builds which are free for commercial use (but only updated for 6 months). There are also free OpenJDK builds which will be updated (including security patches) from other providers like AdoptOpenJDK, Amazon, Azul, BellSoft, IBM, jClarity, Red Hat, the Linux distros et al.

And many others talking about Oracle Java SE licensing changes (Google search)

Tags

JDK bundle contains lots of unnecessary for Docker image stuff, so it was cleaned up. There are 3 tags: *-full (only src tarballs get removed), *-cleaned (desktop parts get cleaned), *-slim (everything but compiler and jvm is removed). master branch refers to jdk8-slim tag, but latest tag points to jdk8-cleaned.

jdk8-slim (master branch) download image size is:

jdk8-cleaned (latest tag) download image size is:

jdk8-full download image size is:

Consider using jre* tags of this image if you only need JRE (you can run Java applications, but cannot build/compile them):

jre8-slim (master branch) download image size is:

jre8-cleaned (latest tag) download image size is:

jre8-full download image size is:

Usage Example

$ echo 'public class Main { public static void main(String[] args) { System.out.println("Hello World"); } }' > Main.java
$ docker run --rm -v "$(pwd)":/mnt --workdir /mnt frolvlad/alpine-java:jdk8-slim sh -c "javac Main.java && java Main"

Once you have run this command you will get printed 'Hello World' from Java!

Tips

Use Docker multi-stage builds to slim down your final Docker images:

FROM frolvlad/alpine-java:jdk8-slim AS builder

RUN echo 'public class Main { public static void main(String[] args) { System.out.println("Hello World"); } }' > Main.java
RUN javac Main.java

FROM frolvlad/alpine-java:jre8-slim
COPY --from=builder /Main.class /

CMD ["java", "Main"]
$ docker build -t my-app .
$ docker run --rm my-app
Hello World

Your application image is going to be only 119MB on disk.

docker-alpine-java's People

Contributors

frol avatar slezhuk avatar smelchior avatar sunkuet02 avatar vancepym avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-alpine-java's Issues

Alpine Java jdk-8u221-b11 docker image

Dear Sir/Madam,

Can you create jdk-8u221-b11 docker image so that I can download it to my local docker repo?

Can you share the Dockerfile with instructions so that I can create jdk docker image myself?

Thank you for your time and help.

Chen Zhang

Could the tag of the images include the Java version?

Just a suggestion, would it be possible to produce your images with the java version in it? Something like 8.121-cleaned.
This would allow for repeatable build using a fixed version of Java and not always using latest Java version when image is pulled.
It would be especially beneficial when you build docker images on multiple machines.
Thanks

Problems with the Dockerfile

i run your dockerfile,
It has the following problems:

why it is Permission denied?

Sending build context to Docker daemon 123.5 MB
Step 1/3 : FROM frolvlad/alpine-glibc:alpine-3.6
Trying to pull repository docker.io/frolvlad/alpine-glibc ...
alpine-3.6: Pulling from docker.io/frolvlad/alpine-glibc
1160f4abea84: Pull complete
0775a9ad393e: Pull complete
Digest: sha256:5615bd3acb292f54fcc6049d0e5b0abac8bcafd895d2e44f3cf5bb7feeb9a443
Status: Downloaded newer image for docker.io/frolvlad/alpine-glibc:alpine-3.6
 ---> 96aed0b92588
Step 2/3 : ENV JAVA_VERSION 8 JAVA_UPDATE 131 JAVA_BUILD 11 JAVA_PATH d54c1d3a095b4ff2b6607d096fa80163 JAVA_HOME "/usr/lib/jvm/default-jvm"
 ---> Running in 879214210fcd
 ---> fa78d971ad6d
Removing intermediate container 879214210fcd
Step 3/3 : RUN apk add --no-cache --virtual=build-dependencies wget ca-certificates unzip &&     cd "/tmp" &&     wget --header "Cookie: oraclelicense=accept-securebackup-cookie;"         "http://download.oracle.com/otn-pub/java/jdk/${JAVA_VERSION}u${JAVA_UPDATE}-b${JAVA_BUILD}/${JAVA_PATH}/jdk-${JAVA_VERSION}u${JAVA_UPDATE}-linux-x64.tar.gz" &&     tar -xzf "jdk-${JAVA_VERSION}u${JAVA_UPDATE}-linux-x64.tar.gz" &&     mkdir -p "/usr/lib/jvm" &&     mv "/tmp/jdk1.${JAVA_VERSION}.0_${JAVA_UPDATE}" "/usr/lib/jvm/java-${JAVA_VERSION}-oracle" &&     ln -s "java-${JAVA_VERSION}-oracle" "$JAVA_HOME" &&     ln -s "$JAVA_HOME/bin/"* "/usr/bin/" &&     rm -rf "$JAVA_HOME/"*src.zip &&     rm -rf "$JAVA_HOME/lib/missioncontrol"            "$JAVA_HOME/lib/visualvm"            "$JAVA_HOME/lib/"*javafx*            "$JAVA_HOME/jre/lib/plugin.jar"            "$JAVA_HOME/jre/lib/ext/jfxrt.jar"            "$JAVA_HOME/jre/bin/javaws"            "$JAVA_HOME/jre/lib/javaws.jar"            "$JAVA_HOME/jre/lib/desktop"            "$JAVA_HOME/jre/plugin"            "$JAVA_HOME/jre/lib/"deploy*            "$JAVA_HOME/jre/lib/"*javafx*            "$JAVA_HOME/jre/lib/"*jfx*            "$JAVA_HOME/jre/lib/amd64/libdecora_sse.so"            "$JAVA_HOME/jre/lib/amd64/"libprism_*.so            "$JAVA_HOME/jre/lib/amd64/libfxplugins.so"            "$JAVA_HOME/jre/lib/amd64/libglass.so"            "$JAVA_HOME/jre/lib/amd64/libgstreamer-lite.so"            "$JAVA_HOME/jre/lib/amd64/"libjavafx*.so            "$JAVA_HOME/jre/lib/amd64/"libjfx*.so &&     wget --header "Cookie: oraclelicense=accept-securebackup-cookie;"         "http://download.oracle.com/otn-pub/java/jce/${JAVA_VERSION}/jce_policy-${JAVA_VERSION}.zip" &&     unzip -jo -d "${JAVA_HOME}/jre/lib/security" "jce_policy-${JAVA_VERSION}.zip" &&     rm "${JAVA_HOME}/jre/lib/security/README.txt" &&     apk del build-dependencies &&     rm "/tmp/"*
 ---> Running in a3a116fb5053

ERROR: Unable to open root: Permission denied
ERROR: Failed to open apk database: Permission denied
The command '/bin/sh -c apk add --no-cache --virtual=build-dependencies wget ca-certificates unzip &&     cd "/tmp" &&     wget --header "Cookie: oraclelicense=accept-securebackup-cookie;"         "http://download.oracle.com/otn-pub/java/jdk/${JAVA_VERSION}u${JAVA_UPDATE}-b${JAVA_BUILD}/${JAVA_PATH}/jdk-${JAVA_VERSION}u${JAVA_UPDATE}-linux-x64.tar.gz" &&     tar -xzf "jdk-${JAVA_VERSION}u${JAVA_UPDATE}-linux-x64.tar.gz" &&     mkdir -p "/usr/lib/jvm" &&     mv "/tmp/jdk1.${JAVA_VERSION}.0_${JAVA_UPDATE}" "/usr/lib/jvm/java-${JAVA_VERSION}-oracle" &&     ln -s "java-${JAVA_VERSION}-oracle" "$JAVA_HOME" &&     ln -s "$JAVA_HOME/bin/"* "/usr/bin/" &&     rm -rf "$JAVA_HOME/"*src.zip &&     rm -rf "$JAVA_HOME/lib/missioncontrol"            "$JAVA_HOME/lib/visualvm"            "$JAVA_HOME/lib/"*javafx*            "$JAVA_HOME/jre/lib/plugin.jar"            "$JAVA_HOME/jre/lib/ext/jfxrt.jar"            "$JAVA_HOME/jre/bin/javaws"            "$JAVA_HOME/jre/lib/javaws.jar"            "$JAVA_HOME/jre/lib/desktop"            "$JAVA_HOME/jre/plugin"            "$JAVA_HOME/jre/lib/"deploy*            "$JAVA_HOME/jre/lib/"*javafx*            "$JAVA_HOME/jre/lib/"*jfx*            "$JAVA_HOME/jre/lib/amd64/libdecora_sse.so"            "$JAVA_HOME/jre/lib/amd64/"libprism_*.so            "$JAVA_HOME/jre/lib/amd64/libfxplugins.so"            "$JAVA_HOME/jre/lib/amd64/libglass.so"            "$JAVA_HOME/jre/lib/amd64/libgstreamer-lite.so"            "$JAVA_HOME/jre/lib/amd64/"libjavafx*.so            "$JAVA_HOME/jre/lib/amd64/"libjfx*.so &&     wget --header "Cookie: oraclelicense=accept-securebackup-cookie;"         "http://download.oracle.com/otn-pub/java/jce/${JAVA_VERSION}/jce_policy-${JAVA_VERSION}.zip" &&     unzip -jo -d "${JAVA_HOME}/jre/lib/security" "jce_policy-${JAVA_VERSION}.zip" &&     rm "${JAVA_HOME}/jre/lib/security/README.txt" &&     apk del build-dependencies &&     rm "/tmp/"*' returned a non-zero code: 243

ldd `which java` results in error

I tried your images and every time I use ldd to see the dynamic libraries, I get the following error although libjli.so is present on the system:

bash-4.3# ldd `which java`
    /lib64/ld-linux-x86-64.so.2 (0x5572e005f000)
    libpthread.so.0 => /lib64/ld-linux-x86-64.so.2 (0x5572e005f000)
Error loading shared library libjli.so: No such file or directory (needed by /usr/bin/java)
    libdl.so.2 => /lib64/ld-linux-x86-64.so.2 (0x5572e005f000)
    libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x5572e005f000)
Error relocating /usr/bin/java: JLI_Launch: symbol not found
bash-4.3# find / -iname "libjli*"
/usr/lib/jvm/java-8-oracle/jre/lib/amd64/jli/libjli.so
/usr/lib/jvm/java-8-oracle/lib/amd64/jli/libjli.so

Openssl missing

Hi Please add openssl package to fix the issue wherein wget can not download using ssl:

wget: can't execute 'ssl_helper': No such file or directory

Any thoughts on a docker-alpine-oraclejre8 ?

I'm looking for the smallest possible image for running a single .jar web app server.
It feels like we could get this more minimal by removing javac and other parts not needed for just running jars.

Problems with the JDK 131 related release

Hello,

I see you're repushing the JDK 131 related images to the Docker Hub. These days we ran into trouble because we were using the slim image as parent image for our projects and their stop recognizing the docker enviroment variables once updated to 131. There was no problem with 121 images, so yesterday we change our code to stick to them. I was preparing a test project to share with you.

Is it a problem you've already solved with the current push?

Thanks

memory usage is so hign when using alpine-oraclejdk8:slim image

I have built two docker images with the same java code, the only difference is the base image, one is based on frolvlad/alpine-oraclejdk8:slim and the other is based on openjdk:8-jdk-alpine. Below is my Dockerfile:

container testing_ms-dictionary_1 is based on frolvlad/alpine-oraclejdk8:slim image

FROM frolvlad/alpine-oraclejdk8:slim
VOLUME /tmp
ADD @[email protected] app.jar
ENV TZ=Asia/Shanghai
ENV JAVA_OPTS="-Xmx512m"
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN sh -c 'touch /app.jar'
ENTRYPOINT exec java $JAVA_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 -XX:+ExitOnOutOfMemoryError -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp -Djava.security.egd=file:/dev/./urandom -jar /app.jar

container testing_ms-dictionary2_1 is based on openjdk:8-jdk-alpine image

FROM openjdk:8-jdk-alpine
VOLUME /tmp
ADD @[email protected] app.jar
ENV TZ=Asia/Shanghai
ENV JAVA_OPTS="-Xmx512m"
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN sh -c 'touch /app.jar'
ENTRYPOINT exec java $JAVA_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 -XX:+ExitOnOutOfMemoryError -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp -Djava.security.egd=file:/dev/./urandom -jar /app.jar

I use ctop command to monitor the memory usage, like below:

image

Why the containermtesting_ms-dictionary_1 based on frolvlad/alpine-oraclejdk8:slim image is so high?

error while build

Hi guys,

Hope you are all well !

--2019-09-06 11:29:34--  http://download.oracle.com/otn-pub/java/jdk/8u202-b08/1961070e4c9b4e26a04e7f5a083f551e/jdk-8u202-linux-x64.tar.gz
Resolving download.oracle.com... 23.210.40.56
Connecting to download.oracle.com|23.210.40.56|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://edelivery.oracle.com/otn-pub/java/jdk/8u202-b08/1961070e4c9b4e26a04e7f5a083f551e/jdk-8u202-linux-x64.tar.gz [following]
--2019-09-06 11:29:34--  https://edelivery.oracle.com/otn-pub/java/jdk/8u202-b08/1961070e4c9b4e26a04e7f5a083f551e/jdk-8u202-linux-x64.tar.gz
Resolving edelivery.oracle.com... 2.18.221.101, 2a02:26f0:ff:1ad::366, 2a02:26f0:ff:182::366
Connecting to edelivery.oracle.com|2.18.221.101|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://download.oracle.com/otn-pub/java/jdk/8u202-b08/1961070e4c9b4e26a04e7f5a083f551e/jdk-8u202-linux-x64.tar.gz?AuthParam=1567769495_656942250c4133bbf5517e3f289a30ec [following]
--2019-09-06 11:29:35--  http://download.oracle.com/otn-pub/java/jdk/8u202-b08/1961070e4c9b4e26a04e7f5a083f551e/jdk-8u202-linux-x64.tar.gz?AuthParam=1567769495_656942250c4133bbf5517e3f289a30ec
Connecting to download.oracle.com|23.210.40.56|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://download.oracle.com/otn-pub/java/jdk/8u202-b08/1961070e4c9b4e26a04e7f5a083f551e/jdk-8u202-linux-x64.tar.gz?AuthParam=1567769495_656942250c4133bbf5517e3f289a30ec [following]
--2019-09-06 11:29:35--  https://download.oracle.com/otn-pub/java/jdk/8u202-b08/1961070e4c9b4e26a04e7f5a083f551e/jdk-8u202-linux-x64.tar.gz?AuthParam=1567769495_656942250c4133bbf5517e3f289a30ec
Connecting to download.oracle.com|23.210.40.56|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2019-09-06 11:29:39 ERROR 404: Not Found.

What are the latest version arguments ?

Cheers,
R

Oracle BCL license agreement

This code is distributed under MIT license, but building the image virtually accepts Oracle's BCL license: http://www.oracle.com/technetwork/java/javase/terms/license/index.html

Actually, by running the built image the user is using the software (Oracle's JRE/JDK) without explicitly accepting (and not even knowing about) the BCL license.

I believe this is the reason why the official Java docker images are openJDK and not Oracle JDK, and this code may be infringing the license agreement with Oracle.

Add JCE unlimited policy

It would be great if this image, or a new child image could be created with the JCE limited policy installed:

I'm currently doing something like:

# add the unlimited strength JCE policy for crypto
RUN apk upgrade --update && \
    apk add --update curl unzip && \
    curl -jksSLH "Cookie: oraclelicense=accept-securebackup-cookie" -o /tmp/unlimited_jce_policy.zip "http://download.oracle.com/otn-pub/java/jce/${JAVA_VERSION}/jce_policy-${JAVA_VERSION}.zip" && \
    unzip -jo -d ${JAVA_HOME}/jre/lib/security /tmp/unlimited_jce_policy.zip && \
    apk del curl unzip && \
    rm -rf /tmp/* /var/cache/apk/*

Frozen tags

Hi, I currently use your cleaned-tag to refer to your image but I see that you rebuild that tag from time to time, would it be possible for you create some tags that you wont move? like slim-1.0.0 or slim-8u74 or something? :)

I think time for an upgrade JDK 8u202

Location: https://download.oracle.com/otn-pub/java/jdk/8u192-b12/750e1c8617c5452694857ad95c3ee230/jdk-8u192-linux-x64.tar.gz?AuthParam=1547574308_d146acccd8e34c5bc0ed68b52b1fa7e0 [following]
--2019-01-15 17:43:08-- https://download.oracle.com/otn-pub/java/jdk/8u192-b12/750e1c8617c5452694857ad95c3ee230/jdk-8u192-linux-x64.tar.gz?AuthParam=1547574308_d146acccd8e34c5bc0ed68b52b1fa7e0
Connecting to download.oracle.com|23.72.217.186|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2019-01-15 17:43:08 ERROR 404: Not Found.

https://www.oracle.com/technetwork/java/javase/overview/index.html

End of Public Updates for Oracle JDK 8

Oracle will not post further updates of Java SE 8 to its public download sites for commercial use after January 2019. Customers who need continued access to critical bug fixes and security fixes as well as general maintenance for Java SE 8 or previous versions can get long term support through Oracle Java SE Subscription or Oracle Java SE Desktop Subscription. For more information, and details on how to receive longer term support for Oracle JDK 8, please see the Oracle Java SE Support Roadmap.

Character encoding problem.

import java.text.NumberFormat;
import java.util.Locale;

public class Test {
  public static void main(final String[] args) {
    NumberFormat fmt = NumberFormat.getCurrencyInstance();
    System.out.println(fmt.format(120.00));
  }
}

Within the running Alpine Linux Docker container, Oracle JDK 8 prints ¤120.00.

env reports LANG=C.UTF-8 I tried changing this to en_US.UTF-8, but it doesn't help. Instead a ? is displayed instead of ¤.

A similar report:
http://stackoverflow.com/questions/35300705/alpine-linux-docker-image-console-encoding-trouble

Any ideas?

Thanks!

Why do I run your dockerfile locally and your size is different?

I really like this image, you are amazing. but I run your dockerfile locally and your size is different.

FROM frolvlad/alpine-glibc:alpine-3.8
ENV JAVA_VERSION=8 \
    JAVA_UPDATE=181 \
    JAVA_BUILD=13 \
    JAVA_PATH=96a7b8442fe848ef90c96a2fad6ed6d1 \
    JAVA_HOME="/usr/lib/jvm/default-jvm"

RUN apk add --no-cache --virtual=build-dependencies wget ca-certificates unzip && \
    cd "/tmp" && \
    wget --header "Cookie: oraclelicense=accept-securebackup-cookie;" \
        "http://download.oracle.com/otn-pub/java/jdk/${JAVA_VERSION}u${JAVA_UPDATE}-b${JAVA_BUILD}/${JAVA_PATH}/jdk-${JAVA_VERSION}u${JAVA_UPDATE}-linux-x64.tar.gz" && \
    tar -xzf "jdk-${JAVA_VERSION}u${JAVA_UPDATE}-linux-x64.tar.gz" && \
    mkdir -p "/usr/lib/jvm" && \
    mv "/tmp/jdk1.${JAVA_VERSION}.0_${JAVA_UPDATE}" "/usr/lib/jvm/java-${JAVA_VERSION}-oracle" && \
    ln -s "java-${JAVA_VERSION}-oracle" "$JAVA_HOME" && \
    ln -s "$JAVA_HOME/bin/"* "/usr/bin/" && \
    rm -rf "$JAVA_HOME/"*src.zip && \
    wget --header "Cookie: oraclelicense=accept-securebackup-cookie;" \
        "http://download.oracle.com/otn-pub/java/jce/${JAVA_VERSION}/jce_policy-${JAVA_VERSION}.zip" && \
    unzip -jo -d "${JAVA_HOME}/jre/lib/security" "jce_policy-${JAVA_VERSION}.zip" && \
    rm "${JAVA_HOME}/jre/lib/security/README.txt" && \
    apk del build-dependencies && \
    rm "/tmp/"*

run result

[root@localhost webapp]# docker images
REPOSITORY      |        TAG                | IMAGE ID            | CREATED              | SIZE
jdk22                  |        latest              |5a73bba13c36     | 3 minutes ago      | 369MB

[root@localhost webapp]# docker history jdk22
IMAGE                     |CREATED              |CREATED BY                                                                    | SIZE                COMMENT
5a73bba13c36        | 7 minutes ago      | /bin/sh -c apk add --no-cache --virtual=buil…             | 357MB
4b6597812a5c        | 12 minutes ago    | /bin/sh -c #(nop)  ENV JAVA_VERSION=8 JAVA_U…    |0B
581aeef13f7b          |38 hours ago        |/bin/sh -c ALPINE_GLIBC_BASE_URL="https://gi…         |8.19MB
<missing>              |38 hours ago         |/bin/sh -c #(nop)  ENV LANG=C.UTF-8                          |0B
<missing>              |5 weeks ago          |/bin/sh -c #(nop)  CMD ["/bin/sh"]                                 | 0B
<missing>              |5 weeks ago          |/bin/sh -c #(nop) ADD file:25f61d70254b9807a…          |  4.41MB

(Not very good typesetting, I hope you see it clearly)
why? What have I done less? Can you tell me, thank you?

Using AlpineLinux as host OS to run Java

I repreated all steps described in dockerfiles on my AlpineLinux, installed in VMWare:

  1. https://github.com/frol/docker-alpine-glibc/blob/master/Dockerfile (install glibc into Alpine)
  2. https://github.com/frol/docker-alpine-oraclejdk8/blob/master/Dockerfile (install Java 8 into Alpine)
    All steps succeeded. But when I run:
    java -version
    I get error:
# java -version
Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x000064eb8837c000, 2555904, 1) failed; error='Operation not permitted' (errno=1)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 2555904 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /home/user/hs_err_pid3520.log

I cannot get how java is running inside your docker container. Did you made some additional kernel or another tunings?
Sorry if this is not directly related to a AlpineJdk8 docker image. I supposed you have experince in running java 8 inside Alpine since you made a nice Docker image :-)

Problem running Minecraft.jar file

Hi,

I tried to run your image with the Minecraft game but without success. I did:

docker run -it --rm -v "$PWD:/data" \
    -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY --device /dev/dri -w /data \
    frolvlad/alpine-oraclejdk8:full java -jar Minecraft.jar

And I got the error:

Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/lib/jvm/java-8-oracle/jre/lib/amd64/libawt_xawt.so: libXext.so.6: cannot open shared object file: No such file or directory

Missing something?

Please tag the repo with OS and JDK versions

It would be great if you could create a tag that has a locked OS and JDK version, like 3.5_8.121.13 so we could lock our code with that specific tag without risking it getting updated to the newer version of these.

How to choose java u version

Is there a way to set the java u version like 8u171 in the dockerFile or somewhere else just to avoid downloading the latest each time?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.