pip install --no-cache-dir <package>
12RUN apt-get install -y net-tools
13RUN apt-get install -y cpio
14RUN pip3 install --upgrade pip
15RUN pip3 install pyresttest16
17COPY . $WDIR/
18
pip install --no-cache-dir <package>
11RUN apt-get install -y python3-pip
12RUN apt-get install -y net-tools
13RUN apt-get install -y cpio
14RUN pip3 install --upgrade pip15RUN pip3 install pyresttest
16
17COPY . $WDIR/
pip install --no-cache-dir <package>
71
72
73# This updates the distro-provided pip and gives us pip3.6 binary
74RUN python3.7 -m pip install --upgrade pip pipenv75
76WORKDIR ${APP_ROOT}
77
pip install --no-cache-dir <package>
25 tk-dev \
26 xz-dev \
27 zlib-dev
28RUN pip install uvloop29RUN apk del .build-deps
30COPY udpserver.py /app/udpserver.py
31EXPOSE 8125/udp
pip install --no-cache-dir <package>
80 mkdir -p /var/www/.cache && \
81 chown www-data:www-data /var/www/.cache
82
83RUN \ 84 python3.6 -m pip install --upgrade pip && \
85 python3.6 -m pip install pipenv
86
Once a package is installed, it does not need to be re-installed and the Docker cache can be leveraged instead. Since the pip cache makes the images larger and is not needed, it's better to disable it.
RUN pip3 install foobar
RUN pip3 install --no-cache-dir foobar