I just saw a command when built a docker image as below
COPY ./ .
I know the parameter "./" which used in Linux or Unix to execute a complied program in the current directory. And the parameter "." present the current directory.
I just confused what is the real purpose of the command COPY ./ .
?
Copy the current directory content to current directory?
Thanks for your help.
2
Answers
This is a Docker command, not a Linux command.
From the Docker manual:
The purpose is to copy all files from the build context (usually the directory on the host that contains the Dockerfile) into the container.
(For reference, the GNU/Linux command to copy files is
cp
)No, absolutely NOT
The COPY instruction takes at least two arguments. The last argument is the destination, and all other arguments are source files