|
1 | 1 | FROM openjdk:8
|
2 | 2 |
|
| 3 | +ENV DEBIAN_FRONTEND=noninteractive |
| 4 | + |
3 | 5 | LABEL com.amazonaws.sagemaker.capabilities.accept-bind-to-port=true
|
4 | 6 |
|
5 | 7 | RUN apt-get update && apt-get -y install apt-utils net-tools apt-transport-https wget curl nginx git maven
|
6 | 8 |
|
| 9 | +RUN apt -y update |
| 10 | +RUN apt -y install python3.6 |
| 11 | + |
| 12 | +ARG OPENSSL_VERSION=1.1.1g |
| 13 | +ARG PYTHON=python3 |
| 14 | +ARG PIP=pip3 |
| 15 | +ARG PYTHON_VERSION=3.6.13 |
| 16 | + |
| 17 | +# Open-SSL |
| 18 | +RUN wget -q -c https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz \ |
| 19 | + && tar -xzf openssl-${OPENSSL_VERSION}.tar.gz \ |
| 20 | + && cd openssl-${OPENSSL_VERSION} \ |
| 21 | + && ./config && make -j $(nproc) && make install \ |
| 22 | + && ldconfig \ |
| 23 | + && cd .. && rm -rf openssl-* \ |
| 24 | + && rmdir /usr/local/ssl/certs \ |
| 25 | + && ln -s /etc/ssl/certs /usr/local/ssl/certs |
| 26 | + |
| 27 | +# Install Python-3.6.13 from source |
| 28 | +RUN wget -q https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz \ |
| 29 | + && tar -xzf Python-$PYTHON_VERSION.tgz \ |
| 30 | + && cd Python-$PYTHON_VERSION \ |
| 31 | + && ./configure \ |
| 32 | + && make -j $(nproc) && make install \ |
| 33 | + && cd .. && rm -rf ../Python-$PYTHON_VERSION* \ |
| 34 | + && ln -s /usr/local/bin/pip3 /usr/bin/pip \ |
| 35 | + && ln -s /usr/local/bin/$PYTHON /usr/local/bin/python \ |
| 36 | + && ${PIP} --no-cache-dir install --upgrade pip |
| 37 | + |
| 38 | +# Remove other Python installations. |
| 39 | +RUN apt -y purge --auto-remove libpython2.7 \ |
| 40 | + && apt -y purge --auto-remove libpython3.7 \ |
| 41 | + && apt -y purge --auto-remove python3.7 \ |
| 42 | + && apt -y purge --auto-remove python2.7 \ |
| 43 | + && apt-get clean \ |
| 44 | + && rm -rf /var/lib/apt/lists/* |
| 45 | + |
7 | 46 | COPY / /sagemaker-sparkml-model-server
|
8 | 47 | WORKDIR /sagemaker-sparkml-model-server
|
9 | 48 |
|
|
0 commit comments