1- # ref: https://github.com/dockerfile/java/tree/master/oracle-java8
21
3- # use the latest LTS Ubuntu
42FROM ubuntu:bionic
53
6475
86ENV DEBIAN_FRONTEND noninteractive
97
8+ # #######################################
109# #### update ubuntu and Install Python 3
11- RUN apt-get update \
12- && apt-get install -y apt-utils automake pkg-config libpcre3-dev zlib1g-dev liblzma-dev \
13- && apt-get install -y curl net-tools build-essential software-properties-common libsqlite3-dev sqlite3 bzip2 libbz2-dev git wget unzip vim python3-pip python3-setuptools python3-dev python3-numpy python3-scipy python3-pandas python3-matplotlib \
14- && apt-get clean \
15- && rm -rf /var/lib/apt/lists/*
10+ # #######################################
11+ RUN apt-get update && \
12+ apt-get install -y apt-utils automake pkg-config libpcre3-dev zlib1g-dev liblzma-dev && \
13+ apt-get install -y curl net-tools build-essential software-properties-common libsqlite3-dev sqlite3 bzip2 libbz2-dev git wget unzip vim python3-pip python3-setuptools python3-dev python3-numpy python3-scipy python3-pandas python3-matplotlib && \
14+ apt-get install -y git xz-utils && \
15+ apt-get clean && \
16+ rm -rf /var/lib/apt/lists/*
1617
18+ ENV INSTALL_DIR=${INSTALL_DIR:-/usr}
19+
20+ # ##################################
1721# ### Install Java 8
22+ # ##################################
1823# ### ---------------------------------------------------------------
1924# ### ---- Change below when upgrading version ----
2025# ### ---------------------------------------------------------------
26+ # # https://download.oracle.com/otn-pub/java/jdk/8u201-b09/42970487e3af4f5aa5bca3f542482c60/jdk-8u201-linux-x64.tar.gz
2127ARG JAVA_MAJOR_VERSION=${JAVA_MAJOR_VERSION:-8}
22- ARG JAVA_UPDATE_VERSION=${JAVA_UPDATE_VERSION:-181}
23- ARG JAVA_BUILD_NUMBER=${JAVA_BUILD_NUMBER:-13}
24- ARG JAVA_DOWNLOAD_TOKEN=${JAVA_DOWNLOAD_TOKEN:-96a7b8442fe848ef90c96a2fad6ed6d1}
25- # # http://download.oracle.com/otn-pub/java/jdk/8u181-b13/96a7b8442fe848ef90c96a2fad6ed6d1/jdk-8u181-linux-x64.tar.gz
26- # # http://download.oracle.com/otn-pub/java/jdk/8u172-b11/a58eab1ec242421181065cdc37240b08/jdk-8u172-linux-x64.tar.gz
28+ ARG JAVA_UPDATE_VERSION=${JAVA_UPDATE_VERSION:-201}
29+ ARG JAVA_BUILD_NUMBER=${JAVA_BUILD_NUMBER:-09}
30+ ARG JAVA_DOWNLOAD_TOKEN=${JAVA_DOWNLOAD_TOKEN:-42970487e3af4f5aa5bca3f542482c60}
2731
2832# ### ---------------------------------------------------------------
2933# ### ---- Don't change below unless you know what you are doing ----
3034# ### ---------------------------------------------------------------
3135ARG UPDATE_VERSION=${JAVA_MAJOR_VERSION}u${JAVA_UPDATE_VERSION}
3236ARG BUILD_VERSION=b${JAVA_BUILD_NUMBER}
3337
34- ENV JAVA_HOME /usr/jdk1.${JAVA_MAJOR_VERSION}.0_${JAVA_UPDATE_VERSION}
35- ENV PATH $PATH:$JAVA_HOME/bin
36- ENV INSTALL_DIR /usr
38+ ENV JAVA_HOME_ACTUAL=${INSTALL_DIR}/jdk1.${JAVA_MAJOR_VERSION}.0_${JAVA_UPDATE_VERSION}
39+ ENV JAVA_HOME=${INSTALL_DIR}/java
40+
41+ ENV PATH=$PATH:${JAVA_HOME}/bin
42+
43+ WORKDIR ${INSTALL_DIR}
3744
3845RUN curl -sL --retry 3 --insecure \
3946 --header "Cookie: oraclelicense=accept-securebackup-cookie;" \
4047 "http://download.oracle.com/otn-pub/java/jdk/${UPDATE_VERSION}-${BUILD_VERSION}/${JAVA_DOWNLOAD_TOKEN}/jdk-${UPDATE_VERSION}-linux-x64.tar.gz" \
4148 | gunzip \
42- | tar x -C $INSTALL_DIR/ \
43- && ln -s $JAVA_HOME $INSTALL_DIR/java \
44- && rm -rf $JAVA_HOME/man
49+ | tar x -C ${INSTALL_DIR}/ \
50+ && rm -rf jdk-${UPDATE_VERSION}-linux-x64.tar.gz # ${JAVA_HOME_ACTUAL}/man
51+
52+ # ###########################
53+ # ### --- JAVA_HOME --- #####
54+ # ###########################
55+ ENV JAVA_HOME=$INSTALL_DIR/java
4556
57+ # ##################################
4658# ### Install Maven 3
47- ENV MAVEN_VERSION 3.5.3
48- ENV MAVEN_HOME /usr/apache-maven-$MAVEN_VERSION
49- ENV PATH $PATH:$MAVEN_HOME/bin
50- RUN curl -sL http://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz \
59+ # ##################################ENV MAVEN_VERSION 3.5.3
60+ ARG MAVEN_VERSION=${MAVEN_VERSION:-3.6.0}
61+ ENV MAVEN_VERSION=${MAVEN_VERSION}
62+ ENV MAVEN_HOME=/usr/apache-maven-${MAVEN_VERSION}
63+ ENV PATH=${PATH}:${MAVEN_HOME}/bin
64+ RUN curl -sL http://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz \
5165 | gunzip \
5266 | tar x -C /usr/ \
53- && ln -s $MAVEN_HOME /usr/maven
67+ && ln -s ${ MAVEN_HOME} /usr/maven
5468
5569# ##################################
5670# ### ---- Pip install packages ----
@@ -61,9 +75,22 @@ COPY requirements.txt ./
6175# # Don't upgrade pip to 10.0.x version -- it's broken!
6276# # Staying with version 8 to avoid the problem
6377# # ---------------------------------------------------
64- # # RUN pip3 install --upgrade pip \
65- # # && pip3 install -r ./requirements.txt
66- RUN pip3 install -r ./requirements.txt
78+
79+ RUN pip3 install --upgrade pip
80+ RUN pip3 install -r ./requirements.txt
81+
82+ # # VERSIONS ##
83+ ENV PATH=${PATH}:${JAVA_HOME}/bin
84+
85+ RUN ln -s ${JAVA_HOME_ACTUAL} ${JAVA_HOME} && \
86+ ls -al ${INSTALL_DIR} && \
87+ echo "JAVA_HOME=$JAVA_HOME" && \
88+ echo "PATH=${PATH}" && export JAVA_HOME=${JAVA_HOME} && export PATH=$PATH && \
89+ java -version && \
90+ mvn --version && \
91+ python -V && \
92+ python3 -V && \
93+ pip3 --version
6794
6895# # VERSIONS ##
6996RUN echo "JAVA_HOME=$JAVA_HOME" && \
@@ -73,9 +100,56 @@ RUN echo "JAVA_HOME=$JAVA_HOME" && \
73100 python3 -V && \
74101 pip3 --version
75102
76- # ### define working directory.
77- RUN mkdir -p /data
78- COPY . /data
103+ # ##################################
104+ # ### ---- Install Gradle ---- #####
105+ # ##################################
106+ ARG GRADLE_INSTALL_BASE=${GRADLE_INSTALL_BASE:-/opt/gradle}
107+ ARG GRADLE_VERSION=${GRADLE_VERSION:-5.1.1}
108+
109+ ARG GRADLE_HOME=${GRADLE_INSTALL_BASE}/gradle-${GRADLE_VERSION}
110+ ENV GRADLE_HOME=${GRADLE_HOME}
111+ ARG GRADLE_PACKAGE=gradle-${GRADLE_VERSION}-bin.zip
112+ ARG GRADLE_PACKAGE_URL=https://services.gradle.org/distributions/${GRADLE_PACKAGE}
113+ # https://services.gradle.org/distributions/gradle-5.1.1-bin.zip
114+ RUN mkdir -p ${GRADLE_INSTALL_BASE} && \
115+ cd ${GRADLE_INSTALL_BASE} && \
116+ wget -c ${GRADLE_PACKAGE_URL} && \
117+ unzip -d ${GRADLE_INSTALL_BASE} ${GRADLE_PACKAGE} && \
118+ ls -al ${GRADLE_HOME} && \
119+ ln -s ${GRADLE_HOME}/bin/gradle /usr/bin/gradle && \
120+ ${GRADLE_HOME}/bin/gradle -v && \
121+ rm -f ${GRADLE_PACKAGE}
122+
123+ # #####################################
124+ # ### ---- NodeJS from Ubuntu ---- ####
125+ # #####################################
126+ # RUN apt-get update -y && \
127+ # apt-get install -y git xz-utils && \
128+ # apt-get install -y nodejs npm && \
129+ # npm --version && \
130+ # apt-get install -y gcc g++ make
131+
132+ # ########################################
133+ # ### ---- Node from NODESOURCES ---- ####
134+ # ########################################
135+ # Ref: https://github.com/nodesource/distributions
136+ ARG NODE_VERSION=${NODE_VERSION:-11}
137+ ENV NODE_VERSION=${NODE_VERSION}
138+ RUN apt-get update -y && \
139+ apt-get install -y sudo curl git xz-utils && \
140+ curl -sL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash - && \
141+ apt-get install -y gcc g++ make && \
142+ apt-get install -y nodejs && \
143+ node -v && npm --version
144+
145+ # ##################################
146+ # ### define working directory. ####
147+ # ##################################
148+ RUN mkdir -p /data
149+
150+ COPY ./printVersions.sh ./
151+ COPY ./examples /data/examples
152+ COPY ./docker-entrypoint.sh /
79153
80154VOLUME "/data"
81155
0 commit comments