Last active
March 13, 2018 11:14
-
-
Save varunpant/b265975a4c85da4045dc1b7658b1b40f to your computer and use it in GitHub Desktop.
Docker Image for Oracle Java with maven 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM oraclelinux:7-slim | |
# Download tar from http://www.oracle.com/technetwork/java/javase/downloads/server-jre9-downloads-3848530.html | |
#d29b6b3008c814abd8ab5e4bde9278d6ee7699898333992ee8d080612b5197ca serverjre-9.0.4_linux-x64_bin.tar.gz | |
MAINTAINER Varun Pant <varun@varunpant.com> | |
ENV JAVA_PKG=serverjre-9*_linux-x64_bin.tar.gz \ | |
JAVA_HOME=/usr/java/default | |
ADD $JAVA_PKG /usr/java/ | |
RUN export JAVA_DIR=$(ls -1 -d /usr/java/*) && \ | |
ln -s $JAVA_DIR /usr/java/latest && \ | |
ln -s $JAVA_DIR /usr/java/default && \ | |
alternatives --install /usr/bin/java java $JAVA_DIR/bin/java 20000 && \ | |
alternatives --install /usr/bin/javac javac $JAVA_DIR/bin/javac 20000 && \ | |
alternatives --install /usr/bin/jar jar $JAVA_DIR/bin/jar 20000 | |
#Download apache mvn via wget , you can skip installing wget if you download apache-maven, manually and just ADD here | |
RUN yum install wget -y | |
RUN wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo | |
RUN yum install apache-maven -y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment