pip install --no-cache-dir <package>
6
7COPY . .
8
9RUN pip3 install -r requirements.txt10
11RUN echo "{\"PLAIDML_DEVICE_IDS\":[\"llvm_cpu.0\"],\"PLAIDML_EXPERIMENTAL\":false}" > /root/.plaidml
12
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