Use COPY instead of ADD for files and folders
51RUN chown docker -R /usr/local/cuda
52
53# Add over the start.sh script
54ADD scripts/start.sh start.sh55
56# Make the script executable
57RUN chmod +x start.sh
Use COPY instead of ADD for files and folders
51RUN chown docker -R /usr/local/cuda
52
53# Add over the start.sh script
54ADD scripts/start.sh start.sh55
56# Make the script executable
57RUN chmod +x start.sh
Description
For items like files and directories that do not require ADD’s tar auto-extraction capability, you should always use COPY
.
Read more about it here.
Bad Practice
FROM python:3.4
ADD requirements.txt /usr/src/app/
Recommended
FROM python:3.4
COPY requirements.txt /usr/src/app/
Exceptions
The best use for ADD
is local tar file auto-extraction into the image.