Error:
Step 3/4 : COPY ~/nginx-1.12.2.tar.gz /usr/local/src
COPY failed: stat /var/lib/docker/tmp/docker-builder709371526/~/nginx-1.12.2.tar.gz: no such file or directory
Solution:
Copy nginx-1.12.2.tar.gz to the Dockerfile directory, and then command to modify the
original command:
COPY ~/nginx-1.12.2.tar.gz /usr/local/src
After modification:
COPY nginx-1.12.2.tar.gz /usr/local/src
The cause of the problem: Because the Mac system is also based on a Docker environment built on a virtual machine, you cannot find a directory like /var/lib/docker/tmp/docker-builderxxx to put the files you need. Therefore, copying the required files to the same directory as the Dockerfile will not have this problem.