Skip to content
This repository was archived by the owner on Jun 2, 2025. It is now read-only.

Upgrade to Python3.6.13 #21

Merged
merged 1 commit into from
Feb 19, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,48 @@
FROM openjdk:8

ENV DEBIAN_FRONTEND=noninteractive

LABEL com.amazonaws.sagemaker.capabilities.accept-bind-to-port=true

RUN apt-get update && apt-get -y install apt-utils net-tools apt-transport-https wget curl nginx git maven

RUN apt -y update
RUN apt -y install python3.6

ARG OPENSSL_VERSION=1.1.1g
ARG PYTHON=python3
ARG PIP=pip3
ARG PYTHON_VERSION=3.6.13

# Open-SSL
RUN wget -q -c https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz \
&& tar -xzf openssl-${OPENSSL_VERSION}.tar.gz \
&& cd openssl-${OPENSSL_VERSION} \
&& ./config && make -j $(nproc) && make install \
&& ldconfig \
&& cd .. && rm -rf openssl-* \
&& rmdir /usr/local/ssl/certs \
&& ln -s /etc/ssl/certs /usr/local/ssl/certs

# Install Python-3.6.13 from source
RUN wget -q https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz \
&& tar -xzf Python-$PYTHON_VERSION.tgz \
&& cd Python-$PYTHON_VERSION \
&& ./configure \
&& make -j $(nproc) && make install \
&& cd .. && rm -rf ../Python-$PYTHON_VERSION* \
&& ln -s /usr/local/bin/pip3 /usr/bin/pip \
&& ln -s /usr/local/bin/$PYTHON /usr/local/bin/python \
&& ${PIP} --no-cache-dir install --upgrade pip

# Remove other Python installations.
RUN apt -y purge --auto-remove libpython2.7 \
&& apt -y purge --auto-remove libpython3.7 \
&& apt -y purge --auto-remove python3.7 \
&& apt -y purge --auto-remove python2.7 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

COPY / /sagemaker-sparkml-model-server
WORKDIR /sagemaker-sparkml-model-server

Expand Down