@@ -31,13 +31,24 @@ RUN echo "deb $DEBIAN_REPO/debian stretch main" > /etc/apt/sou
3131 lsb-release \
3232 procps \
3333 openssl \
34+ make \
35+ libssl-dev \
36+ zlib1g-dev \
37+ libbz2-dev \
38+ libreadline-dev \
39+ libsqlite3-dev \
40+ llvm \
41+ libncurses5-dev \
42+ libncursesw5-dev \
43+ xz-utils \
44+ tk-dev \
3445 # to support userScript pip installs via git
3546 git \
3647 locales \
3748
3849 # R separately because it depends on gnupg installed above
3950 && echo "deb $CRAN_REPO/bin/linux/debian stretch-cran35/" >> /etc/apt/sources.list \
40- && apt-key adv --no-tty --keyserver keys.gnupg.net \
51+ && apt-key adv --no-tty --keyserver keyserver.ubuntu.com \
4152 --recv-key 'E19F5F87128899B192B1A2C2AD5F960A256A04AF' \
4253
4354 # Uncomment en_US.UTF-8 for inclusion in generation
@@ -61,9 +72,9 @@ ENV LC_ALL en_US.UTF-8
6172# Java
6273# ######################
6374
64- ENV JAVA_VER jdk1.8.0_191
65- ENV JAVA_TGZ jdk-8u191 -linux-x64.tar.gz
66- ENV JAVA_URL http ://download.oracle.com/otn-pub/java/jdk/8u191-b12/2787e4a523244c269598db4e85c51e0c /$JAVA_TGZ
75+ ENV JAVA_VER jdk1.8.0_201
76+ ENV JAVA_TGZ jdk-8u201 -linux-x64.tar.gz
77+ ENV JAVA_URL https ://download.oracle.com/otn-pub/java/jdk/8u201-b09/42970487e3af4f5aa5bca3f542482c60 /$JAVA_TGZ
6778ENV JAVA_HOME /usr/lib/jdk/$JAVA_VER
6879
6980RUN wget --header "Cookie: oraclelicense=accept-securebackup-cookie" $JAVA_URL \
@@ -130,7 +141,7 @@ RUN apt-get update \
130141
131142 # NOTE! not sure why, but this must run before pip installation
132143 && useradd -m -s /bin/bash -N -u $UID $USER \
133- # jessie's default pip doesn't work well with jupyter
144+ # jessie's default pip doesn't work well with jupyter
134145 && wget -nv https://bootstrap.pypa.io/get-pip.py \
135146 && python get-pip.py \
136147 && pip install ipykernel==4.10.0 \
@@ -166,16 +177,79 @@ RUN apt-get update \
166177
167178
168179# Python 3 Kernel
180+ ENV PYTHON_VERSION 3.6.8
181+
182+ # lifted from https://github.com/docker-library/python/blob/dd36c08c1f94083476a8579b8bf20c4cd46c6400/3.6/stretch/Dockerfile
183+ RUN set -ex \
184+ \
185+ && wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \
186+ && wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \
187+ && export GNUPGHOME="$(mktemp -d)" \
188+ && gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D" \
189+ && gpg --batch --verify python.tar.xz.asc python.tar.xz \
190+ && { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \
191+ && rm -rf "$GNUPGHOME" python.tar.xz.asc \
192+ && mkdir -p /usr/src/python \
193+ && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \
194+ && rm python.tar.xz \
195+ \
196+ && cd /usr/src/python \
197+ && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
198+ && ./configure \
199+ --build="$gnuArch" \
200+ --enable-loadable-sqlite-extensions \
201+ --enable-shared \
202+ --with-system-expat \
203+ --with-system-ffi \
204+ --without-ensurepip \
205+ && make -j "$(nproc)" \
206+ && make install \
207+ && ldconfig \
208+ \
209+ && find /usr/local -depth \
210+ \( \
211+ \( -type d -a \( -name test -o -name tests \) \) \
212+ -o \
213+ \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
214+ \) -exec rm -rf '{}' + \
215+ && rm -rf /usr/src/python \
216+ \
217+ && python3 --version
218+
219+ # make some useful symlinks that are expected to exist
220+ RUN cd /usr/local/bin \
221+ && ln -s idle3 idle \
222+ && ln -s pydoc3 pydoc \
223+ && ln -s python3 python \
224+ && ln -s python3-config python-config
225+
226+ # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
227+ ENV PYTHON_PIP_VERSION 19.0.1
228+
229+ RUN set -ex; \
230+ \
231+ wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py' ; \
232+ \
233+ python get-pip.py \
234+ --disable-pip-version-check \
235+ --no-cache-dir \
236+ "pip==$PYTHON_PIP_VERSION" \
237+ ; \
238+ pip --version; \
239+ \
240+ find /usr/local -depth \
241+ \( \
242+ \( -type d -a \( -name test -o -name tests \) \) \
243+ -o \
244+ \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
245+ \) -exec rm -rf '{}' +; \
246+ rm -f get-pip.py
247+
169248RUN apt-get update \
170249 && apt-get install -t testing -yq --no-install-recommends \
171- python3.6 \
172- python3.6-dev \
173- python3-distutils \
174250 # for jupyterlab extensions
175251 nodejs \
176252 npm \
177- && update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 100 \
178- && python3 get-pip.py \
179253 && pip3 install tornado==4.5.3 \
180254# # Hail requires decorator
181255 && pip3 install -U decorator==4.3.0 \
@@ -215,7 +289,7 @@ RUN apt-get update \
215289 && rm -rf /var/lib/apt/lists/*
216290
217291# fixed current ggplot issue where it imports Timestamp from pandas.lib (deprecated) instead of pandas
218- RUN sed -i 's/pandas.lib/pandas/g' /usr/local/lib/python3.6/dist -packages/ggplot/stats/smoothers.py
292+ RUN sed -i 's/pandas.lib/pandas/g' /usr/local/lib/python3.6/site -packages/ggplot/stats/smoothers.py
219293
220294# make pip install to a user directory, instead of a system directory which requires root.
221295# this is useful so `pip install` commands can be run in the context of a notebook.
@@ -281,4 +355,4 @@ USER $USER
281355WORKDIR $HOME
282356
283357EXPOSE $JUPYTER_PORT
284- ENTRYPOINT ["/usr/local/bin/jupyter" , "notebook" ]
358+ ENTRYPOINT ["/usr/local/bin/jupyter" , "notebook" ]
0 commit comments