Skip to content

Commit 28dafc8

Browse files
authored
upgrade pillow etc. to fix safety issues in 1.4.0 dockerfiles (#63)
1 parent 954d1eb commit 28dafc8

File tree

5 files changed

+23
-10
lines changed

5 files changed

+23
-10
lines changed

docker/1.4.0/py2/Dockerfile.cpu

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ RUN conda install -c \
5858
&& conda install -y \
5959
scikit-learn==0.20.3 \
6060
pandas==0.24.2 \
61-
pillow==6.2.1 \
6261
h5py==2.9.0 \
6362
requests==2.22.0 \
6463
&& conda install \
6564
pytorch==$PYTORCH_VERSION \
6665
torchvision==$TORCHVISION_VERSION cpuonly -c pytorch \
6766
&& conda clean -ya \
6867
&& pip install --upgrade pip --trusted-host pypi.org --trusted-host files.pythonhosted.org \
69-
&& pip install mxnet-model-server==$MMS_VERSION
68+
&& pip install mxnet-model-server==$MMS_VERSION \
69+
&& pip install --no-cache-dir pillow==6.2.2
7070

7171
RUN useradd -m model-server \
7272
&& mkdir -p /home/model-server/tmp \
@@ -81,6 +81,9 @@ RUN pip install --no-cache-dir "sagemaker-pytorch-inference<2"
8181

8282
RUN curl https://aws-dlc-licenses.s3.amazonaws.com/pytorch-1.4.0/license.txt -o /license.txt
8383

84+
RUN conda install -y -c conda-forge pyyaml==5.3.1
85+
RUN pip install sagemaker-containers==2.8.6 urllib3==1.25.8
86+
8487
EXPOSE 8080 8081
8588
ENTRYPOINT ["python", "/usr/local/bin/dockerd-entrypoint.py"]
8689
CMD ["mxnet-model-server", "--start", "--mms-config", "/home/model-server/config.properties"]

docker/1.4.0/py2/Dockerfile.gpu

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ RUN conda install -c \
7070
&& conda install -y scikit-learn==0.20.3 \
7171
h5py==2.9.0 \
7272
pandas==0.24.2 \
73-
pillow==6.2.1 \
7473
requests==2.22.0 \
7574
&& conda install -c \
7675
pytorch \
@@ -80,7 +79,8 @@ RUN conda install -c \
8079
&& conda clean -ya \
8180
&& /opt/conda/bin/conda config --set ssl_verify False \
8281
&& pip install --upgrade pip --trusted-host pypi.org --trusted-host files.pythonhosted.org \
83-
&& pip install mxnet-model-server==$MMS_VERSION
82+
&& pip install mxnet-model-server==$MMS_VERSION \
83+
&& pip install --no-cache-dir pillow==6.2.2
8484

8585
RUN useradd -m model-server \
8686
&& mkdir -p /home/model-server/tmp \
@@ -105,6 +105,9 @@ RUN pip install --no-cache-dir "sagemaker-pytorch-inference<2"
105105

106106
RUN curl https://aws-dlc-licenses.s3.amazonaws.com/pytorch-1.4.0/license.txt -o /license.txt
107107

108+
RUN conda install -y -c conda-forge pyyaml==5.3.1
109+
RUN pip install sagemaker-containers==2.8.6 urllib3==1.25.8
110+
108111
EXPOSE 8080 8081
109112
ENTRYPOINT ["python", "/usr/local/bin/dockerd-entrypoint.py"]
110113
CMD ["mxnet-model-server", "--start", "--mms-config", "/home/model-server/config.properties"]

docker/1.4.0/py3/Dockerfile.cpu

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ RUN conda install -c \
5656
&& conda install -y \
5757
scikit-learn==0.21.2 \
5858
pandas==0.25.0 \
59-
pillow==6.2.1 \
6059
h5py==2.9.0 \
6160
requests==2.22.0 \
6261
&& conda install \
@@ -65,7 +64,8 @@ RUN conda install -c \
6564
&& conda clean -ya \
6665
&& pip install --upgrade pip --trusted-host pypi.org --trusted-host files.pythonhosted.org \
6766
&& ln -s /opt/conda/bin/pip /usr/local/bin/pip3 \
68-
&& pip install mxnet-model-server==$MMS_VERSION
67+
&& pip install mxnet-model-server==$MMS_VERSION \
68+
&& pip install --no-cache-dir pillow==7.1.0
6969

7070
RUN useradd -m model-server \
7171
&& mkdir -p /home/model-server/tmp \
@@ -80,6 +80,9 @@ RUN pip install --no-cache-dir "sagemaker-pytorch-inference<2"
8080

8181
RUN curl https://aws-dlc-licenses.s3.amazonaws.com/pytorch-1.4.0/license.txt -o /license.txt
8282

83+
RUN conda install -y -c conda-forge pyyaml==5.3.1
84+
RUN pip install sagemaker-containers==2.8.6
85+
8386
EXPOSE 8080 8081
8487
ENTRYPOINT ["python", "/usr/local/bin/dockerd-entrypoint.py"]
8588
CMD ["mxnet-model-server", "--start", "--mms-config", "/home/model-server/config.properties"]

docker/1.4.0/py3/Dockerfile.gpu

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ RUN conda install -c \
7070
&& conda install -y \
7171
scikit-learn==0.21.2 \
7272
pandas==0.25.0 \
73-
pillow==6.2.1 \
7473
h5py==2.9.0 \
7574
requests==2.22.0 \
7675
&& conda install -c \
@@ -82,7 +81,8 @@ RUN conda install -c \
8281
&& /opt/conda/bin/conda config --set ssl_verify False \
8382
&& pip install --upgrade pip --trusted-host pypi.org --trusted-host files.pythonhosted.org \
8483
&& ln -s /opt/conda/bin/pip /usr/local/bin/pip3 \
85-
&& pip install mxnet-model-server==$MMS_VERSION
84+
&& pip install mxnet-model-server==$MMS_VERSION \
85+
&& pip install --no-cache-dir pillow==7.1.0
8686

8787
RUN useradd -m model-server \
8888
&& mkdir -p /home/model-server/tmp \
@@ -97,6 +97,9 @@ RUN pip install --no-cache-dir "sagemaker-pytorch-inference<2"
9797

9898
RUN curl https://aws-dlc-licenses.s3.amazonaws.com/pytorch-1.4.0/license.txt -o /license.txt
9999

100+
RUN conda install -y -c conda-forge pyyaml==5.3.1
101+
RUN pip install sagemaker-containers==2.8.6
102+
100103
EXPOSE 8080 8081
101104
ENTRYPOINT ["python", "/usr/local/bin/dockerd-entrypoint.py"]
102105
CMD ["mxnet-model-server", "--start", "--mms-config", "/home/model-server/config.properties"]

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ def read(fname):
4646
'Programming Language :: Python :: 2.7',
4747
'Programming Language :: Python :: 3.6',
4848
],
49-
install_requires=['numpy==1.16.4', 'Pillow==6.2.0', 'retrying==1.3.3', 'sagemaker-containers==2.5.4',
50-
'six==1.12.0', 'requests_mock==1.6.0', 'sagemaker-inference==1.2.2',
49+
50+
install_requires=['numpy==1.16.4', 'Pillow>=6.2.0', 'retrying==1.3.3', 'sagemaker-containers>=2.5.4',
51+
'six==1.12.0', 'requests_mock==1.6.0', 'sagemaker-inference>=1.2.2',
5152
'retrying==1.3.3'],
5253
extras_require={
5354
'test': ['boto3==1.10.32', 'coverage==4.5.3', 'docker-compose==1.23.2', 'flake8==3.7.7', 'Flask==1.1.1',

0 commit comments

Comments
 (0)