Mercurial > hg > Applications > docker-wrapper
changeset 28:3db5360e6e35
Update java9
author | innparusu |
---|---|
date | Tue, 12 Dec 2017 16:45:22 +0900 |
parents | 3e6cf8f3aa62 |
children | 991e5e7fc82a |
files | dockerfiles/java-centos/Dockerfile script/killdockerbyimage.pl |
diffstat | 2 files changed, 41 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/dockerfiles/java-centos/Dockerfile Tue Dec 05 14:03:34 2017 +0900 +++ b/dockerfiles/java-centos/Dockerfile Tue Dec 12 16:45:22 2017 +0900 @@ -1,2 +1,27 @@ FROM centos -RUN yum install -y java zsh vim emacs && yum clean all + +# Java Version +ENV JAVA_VERSION=9.0.1 \ + JAVA_BUILD=11 \ + JAVA_HOME=/usr/lib/jvm/current-java + +# Openjdk http://download.java.net/java/GA/jdk9/9.0.1/binaries/openjdk-9.0.1_linux-x64_bin.tar.gz + +RUN yum install -y wget tar + +RUN cd /tmp && \ + wget "http://download.java.net/java/GA/jdk9/${JAVA_VERSION}/binaries/openjdk-${JAVA_VERSION}_linux-x64_bin.tar.gz" && \ + tar xzf "openjdk-${JAVA_VERSION}_linux-x64_bin.tar.gz" && \ + mkdir -p /usr/lib/jvm && mv "/tmp/jdk-${JAVA_VERSION}" "/usr/lib/jvm/openjdk-${JAVA_VERSION}" && \ + ln -s "openjdk-${JAVA_VERSION}" $JAVA_HOME && \ + ln -s $JAVA_HOME/bin/java /usr/bin/java && \ + ln -s $JAVA_HOME/bin/javac /usr/bin/javac && \ + ln -s $JAVA_HOME/bin/jshell /usr/bin/jshell + +RUN rm -rf $JAVA_HOME/*.txt && \ + rm -rf $JAVA_HOME/*.html && \ + rm -rf $JAVA_HOME/man && \ + rm -rf $JAVA_HOME/lib/src.zip && \ + rm /tmp/* + +RUN yum install -y zsh vim emacs && yum clean all
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/script/killdockerbyimage.pl Tue Dec 12 16:45:22 2017 +0900 @@ -0,0 +1,15 @@ +#!/usr/bin/perl + +my $image = $ARGV[0]; +my $run = $ARGV[1]; +open my $fd, "docker ps -a | grep $image |"; +while (<$fd>) { + if (/^[0-9a-f]+/) { + my $cid = $&; + if ($run eq "kill") { + system "docker rm $cid"; + } else { + print "docker rm $cid\n"; + } + } +}