diff --git a/Dockerfile b/Dockerfile index 3cb28c0bcc..5565a01717 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,13 @@ -FROM python:3.6 +FROM python:3.6-slim -RUN apt-get -y update && apt-get -y install ffmpeg +# Security: Be specific on version, so use ffmpeg= +RUN apt-get update && apt-get -y upgrade && apt-get install -y ffmpeg # RUN apt-get -y update && apt-get -y install git wget python-dev python3-dev libopenmpi-dev python-pip zlib1g-dev cmake python-opencv ENV CODE_DIR /root/code +# Security: Preserve the ownership of the files and directories, so that the files are owned by the right user and group. +# So use COPY --chown= . $CODE_DIR/baselines COPY . $CODE_DIR/baselines WORKDIR $CODE_DIR/baselines @@ -13,6 +16,6 @@ RUN rm -rf __pycache__ && \ find . -name "*.pyc" -delete && \ pip install 'tensorflow < 2' && \ pip install -e .[test] - - -CMD /bin/bash + +RUN apt-get clean +CMD ["/bin/bash"]