forked from DrSnowbird/jdk-mvn-py3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
executable file
·143 lines (116 loc) · 4.92 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
FROM ubuntu:xenial
# use the latest LTS Ubuntu
MAINTAINER openkbs.org@gmail.com
ENV DEBIAN_FRONTEND noninteractive
# ref: https://github.com/dockerfile/java/tree/master/oracle-java8
########################################
##### update ubuntu and Install Python 3
########################################
RUN apt-get update && \
apt-get install -y apt-utils automake pkg-config libpcre3-dev zlib1g-dev liblzma-dev && \
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 && \
apt-get install -y git xz-utils && \
ln -s /usr/bin/python3 /usr/bin/python && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
ENV INSTALL_DIR=${INSTALL_DIR:-/usr}
###################################
#### Install Java 8
###################################
#### ---------------------------------------------------------------
#### ---- Change below when upgrading version ----
#### ---------------------------------------------------------------
## http://download.oracle.com/otn-pub/java/jdk/8u191-b12/2787e4a523244c269598db4e85c51e0c/jdk-8u191-linux-x64.tar.gz
ARG JAVA_MAJOR_VERSION=${JAVA_MAJOR_VERSION:-8}
ARG JAVA_UPDATE_VERSION=${JAVA_UPDATE_VERSION:-191}
ARG JAVA_BUILD_NUMBER=${JAVA_BUILD_NUMBER:-12}
ARG JAVA_DOWNLOAD_TOKEN=${JAVA_DOWNLOAD_TOKEN:-2787e4a523244c269598db4e85c51e0c}
#### ---------------------------------------------------------------
#### ---- Don't change below unless you know what you are doing ----
#### ---------------------------------------------------------------
ARG UPDATE_VERSION=${JAVA_MAJOR_VERSION}u${JAVA_UPDATE_VERSION}
ARG BUILD_VERSION=b${JAVA_BUILD_NUMBER}
ENV JAVA_HOME_ACTUAL=${INSTALL_DIR}/jdk1.${JAVA_MAJOR_VERSION}.0_${JAVA_UPDATE_VERSION}
ENV JAVA_HOME=${INSTALL_DIR}/java
ENV PATH=$PATH:${JAVA_HOME}/bin
WORKDIR ${INSTALL_DIR}
RUN curl -sL --retry 3 --insecure \
--header "Cookie: oraclelicense=accept-securebackup-cookie;" \
"http://download.oracle.com/otn-pub/java/jdk/${UPDATE_VERSION}-${BUILD_VERSION}/${JAVA_DOWNLOAD_TOKEN}/jdk-${UPDATE_VERSION}-linux-x64.tar.gz" \
| gunzip \
| tar x -C ${INSTALL_DIR}
RUN ls -al ${INSTALL_DIR} && \
ln -s ${JAVA_HOME_ACTUAL} ${JAVA_HOME} && \
rm -rf ${JAVA_HOME}/man
############################
#### --- JAVA_HOME --- #####
############################
ENV JAVA_HOME=$INSTALL_DIR/java
###################################
#### Install Maven 3
###################################
ARG MAVEN_VERSION=${MAVEN_VERSION:-3.6.0}
ENV MAVEN_VERSION=${MAVEN_VERSION}
ENV MAVEN_HOME=/usr/apache-maven-${MAVEN_VERSION}
ENV PATH=${PATH}:${MAVEN_HOME}/bin
RUN curl -sL http://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz \
| gunzip \
| tar x -C /usr/ \
&& ln -s ${MAVEN_HOME} /usr/maven
###################################
#### ---- Pip install packages ----
###################################
COPY requirements.txt ./
## ---------------------------------------------------
## Don't upgrade pip to 10.0.x version -- it's broken!
## Staying with version 8 to avoid the problem
## ---------------------------------------------------
RUN pip3 install --upgrade pip
RUN pip3 install -r ./requirements.txt
## VERSIONS ##
ENV PATH=${PATH}:${JAVA_HOME}/bin
RUN ln -s ${JAVA_HOME_ACTUAL} ${JAVA_HOME} && \
ls -al ${INSTALL_DIR} && \
echo "PATH=${PATH}" && export JAVA_HOME=${JAVA_HOME} && export PATH=$PATH && \
java -version && \
mvn --version && \
python -V && \
python3 -V && \
pip3 --version
###################################
#### ---- Install Gradle ---- #####
###################################
ARG GRADLE_INSTALL_BASE=${GRADLE_INSTALL_BASE:-/opt/gradle}
ARG GRADLE_VERSION=${GRADLE_VERSION:-5.1.1}
ARG GRADLE_HOME=${GRADLE_INSTALL_BASE}/gradle-${GRADLE_VERSION}
ENV GRADLE_HOME=${GRADLE_HOME}
ARG GRADLE_PACKAGE=gradle-${GRADLE_VERSION}-bin.zip
ARG GRADLE_PACKAGE_URL=https://services.gradle.org/distributions/${GRADLE_PACKAGE}
# https://services.gradle.org/distributions/gradle-5.1.1-bin.zip
RUN \
mkdir -p ${GRADLE_INSTALL_BASE} && \
cd ${GRADLE_INSTALL_BASE} && \
wget -c ${GRADLE_PACKAGE_URL} && \
unzip -d ${GRADLE_INSTALL_BASE} ${GRADLE_PACKAGE} && \
ls -al ${GRADLE_HOME} && \
ln -s ${GRADLE_HOME}/bin/gradle /usr/bin/gradle && \
${GRADLE_HOME}/bin/gradle -v && \
rm -f ${GRADLE_PACKAGE}
##################################
#### ---- NodeJS install ---- ####
##################################
RUN \
apt-get update -y && \
apt-get install -y git xz-utils && \
apt-get install -y nodejs npm && \
npm --version && \
apt-get install -y gcc g++ make
###################################
#### define working directory. ####
###################################
RUN mkdir -p /data
COPY ./printVersions.sh ./
VOLUME "/data"
WORKDIR /data
#### Define default command.
CMD ["/bin/bash"]