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

Commit 28017d2

Browse files
mahithsureshmahithsuresh
andauthored
Python 2.7 is known to have a security vulnerability. Upgrade to Python 3.6.13 (#21)
openjdk:8 (the base image used by the spark container) has a dependency on python 2.7.16 which has a security vulnerability. Since openjdk:8 has not been updated and since python 2.7.16 has reached EOL, we are upgrading to python 3.6.13 which contains the fix for the vulnerability. Co-authored-by: mahithsuresh <mahitm@amazon.com>
1 parent c2d7c7b commit 28017d2

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

Dockerfile

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,48 @@
11
FROM openjdk:8
22

3+
ENV DEBIAN_FRONTEND=noninteractive
4+
35
LABEL com.amazonaws.sagemaker.capabilities.accept-bind-to-port=true
46

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

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+
746
COPY / /sagemaker-sparkml-model-server
847
WORKDIR /sagemaker-sparkml-model-server
948

0 commit comments

Comments
 (0)