The COPY instruction copies files from the source in the first part of this instruction to the destination specified in the second part:
- COPY <src> <dest>
- COPY ["<src">, "<dest>"] // useful when paths contain whitespace
The <src> in the COPY instruction may contain wildcards with the matching done using Go's filepath.Match rules.
Note:
- <src> must be part of the context for the build, you cannot specify relative folders such as ../;
- A root / specified in the <src> will be the root of the context
- A root / specified in the <dest> will map to the containers root file system
- Specifying a COPY instruction without a destination will copy the file or folder into the WORKDIR with the same name as the original