forked from tronprotocol/java-tron
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
42 lines (35 loc) · 1.27 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
FROM tronprotocol/centos7
ENV TMP_DIR="/tron-build"
ENV JDK_TAR="jdk-8u202-linux-x64.tar.gz"
ENV JDK_DIR="jdk1.8.0_202"
ENV JDK_MD5="0029351f7a946f6c05b582100c7d45b7"
ENV BASE_DIR="/java-tron"
RUN set -o errexit -o nounset \
&& yum -y install git wget \
&& wget -P /usr/local https://github.com/frekele/oracle-java/releases/download/8u202-b08/$JDK_TAR \
&& echo "$JDK_MD5 /usr/local/$JDK_TAR" | md5sum -c \
&& tar -zxf /usr/local/$JDK_TAR -C /usr/local\
&& rm /usr/local/$JDK_TAR \
&& export JAVA_HOME=/usr/local/$JDK_DIR \
&& export CLASSPATH=$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar \
&& export PATH=$PATH:$JAVA_HOME/bin \
&& echo "git clone" \
&& mkdir -p $TMP_DIR \
&& cd $TMP_DIR \
&& git clone https://github.com/tronprotocol/java-tron.git \
&& cd java-tron \
&& git checkout docker \
&& ./gradlew build -x test \
&& cd build/distributions \
&& unzip -o java-tron-1.0.0.zip \
&& mv java-tron-1.0.0 $BASE_DIR \
&& rm -rf $TMP_DIR \
&& rm -rf ~/.gradle \
&& mv $JAVA_HOME/jre /usr/local \
&& rm -rf $JAVA_HOME \
&& yum clean all
ENV JAVA_HOME="/usr/local/jre"
ENV PATH=$PATH:$JAVA_HOME/bin
COPY docker-entrypoint.sh $BASE_DIR/bin
WORKDIR $BASE_DIR
ENTRYPOINT ["./bin/docker-entrypoint.sh"]