April 2017
Beginner
404 pages
9h 30m
English
The COPY instruction copies the files/folders from the source to the destined location on the intermediate image or layer and commits if the copy is successful. So the commit image will have these files under the destined path whenever a new container is created. There can be any number of COPY instructions in a Dockerfile. It is mandatory for the source to be within the build context (in this case, the current folder or root); we cannot point to files that are remotely located. In the following example, Docker copies the index.htm file from the build context to the /inetpub/wwwroot location on the container, which is the default location for the IIS web server:
COPY index.htm /inetpub/wwwroot/
Read now
Unlock full access