I'm building an Docker image with big files (>1.0GB) and small python scripts. Big files are rarely changed, so I want to caching it.
The directory is looks like:
- app/
- main.py
- modules/
- foo.py
- bar.py
- big_files/
- bigone.tar
- bigtwo.tar
My first Dockerfile:
FROM python3:latest
COPY ./app /opt/app
When I update python scripts, it have to COPY all files which consume a long time.
What I want to acheive:
FROM python3:latest
COPY ./app/big_files /opt/app/big_files
COPY ./app /opt/app
However, it also copy big files too.
How to COPY in two step for caching?