Commit 14c65850 authored by Sebastien Gardoll's avatar Sebastien Gardoll
Browse files

automatically download the last 1.8 jdk ; fix warning when installing python setuptools

parent 3973eb2f
Loading
Loading
Loading
Loading
+12 −12
Original line number Diff line number Diff line
@@ -31,15 +31,13 @@ RUN yum groupinstall -y development && \

# install Oracle Java 8
# see download string at: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
# run scripts/get_oracle_jdk_linux_x64.sh to identify the correct URL
# run manually scripts/get_oracle_jdk_linux_x64.sh to identify the correct URL

ENV JAVA_VERSION 8u162
ENV JAVA_BUILD_VERSION b12
ENV JAVA_HASH=0da788060d494f5095bf8624735fa2f1
COPY scripts/get_jdk_rpm_address.sh /tmp

RUN wget -q --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" \
    -O /tmp/jdk-8-linux-x64.rpm \
    "http://download.oracle.com/otn-pub/java/jdk/${JAVA_VERSION}-${JAVA_BUILD_VERSION}/${JAVA_HASH}/jdk-${JAVA_VERSION}-linux-x64.rpm"
RUN /tmp/get_jdk_rpm_address.sh | xargs wget -q --no-cookies --no-check-certificate\
  --header "Cookie: oraclelicense=accept-securebackup-cookie" \
  -O /tmp/jdk-8-linux-x64.rpm

RUN yum -y install /tmp/jdk-8-linux-x64.rpm && \
    rm /tmp/jdk-8-linux-x64.rpm
@@ -65,14 +63,13 @@ ENV LD_LIBRARY_PATH=/usr/local/lib:/usr/local/bin/python:$LD_LIBRARY_PATH

# install additional core Python packages
ENV PILLOW_VERSION 2.8.2
RUN cd /tmp
RUN wget -q --no-check-certificate https://bootstrap.pypa.io/ez_setup.py
RUN python ez_setup.py --insecure
RUN rm -rf ez_setup.py
RUN easy_install pip
RUN wget https://bootstrap.pypa.io/get-pip.py -O /tmp/get-pip.py
RUN python /tmp/get-pip.py

RUN pip install virtualenv
RUN pip install wheel
RUN pip install --use-wheel Pillow==${PILLOW_VERSION}
RUN pip install setuptools

# supervisor
# executable: /usr/local/bin/supervisord
@@ -84,6 +81,9 @@ COPY conf/supervisord.conf /etc/supervisord.conf
COPY conf/supervisord_noothers.conf /etc/supervisord_noothers.conf
RUN mkdir -p /etc/supervisor/conf.d/

# clean tmp directory
RUN rm -fr /tmp/*

# default command starts supervisor in non-daemon mode
# to be overridden by child images
# NOTE: do not use ENTRYPOINT as it would interfere with arguments to certificate generation
+33 −0
Original line number Diff line number Diff line
#!/bin/bash

# You must accept the Oracle Binary Code License
# http://www.oracle.com/technetwork/java/javase/terms/license/index.html
# usage: get_jdk.sh <jdk_version> <ext>
# jdk_version: 8(default) or 9
# ext: rpm or tar.gz

jdk_version=${1:-8}
ext=${2:-rpm}

readonly url="http://www.oracle.com"
readonly jdk_download_url1="$url/technetwork/java/javase/downloads/index.html"
readonly jdk_download_url2=$(
    curl -s $jdk_download_url1 | \
    egrep -o "\/technetwork\/java/\javase\/downloads\/jdk${jdk_version}-downloads-.+?\.html" | \
    head -1 | \
    cut -d '"' -f 1
)

[[ -z "$jdk_download_url2" ]] && echo "Could not get jdk download url - $jdk_download_url1" >> /dev/stderr


readonly jdk_download_url3="${url}${jdk_download_url2}"
readonly jdk_download_rmp_address=$(
    curl -s $jdk_download_url3 | \
    egrep -o "http\:\/\/download.oracle\.com\/otn-pub\/java\/jdk\/[8-9](u[0-9]+|\+).*\/jdk-${jdk_version}.*(-|_)linux-(x64|x64_bin).$ext"
)


echo $jdk_download_rmp_address

exit 0
 No newline at end of file