copy
The copy
module is a short-hand method of adding a COPY
instruction into the image. This can be used to copy files from images, other stages, or even from the build context.
Usage
The copy
module’s properties are a 1-1 match with the COPY
instruction containing src
, dest
, and from
(optional). The example below will COPY
the file /usr/bin/yq
from docker.io/mikefarah/yq
into /usr/bin/
.
Creating an instruction like:
Omitting from:
will allow copying from the build context:
Creating an instruction like:
Example configuration
Configuration options
from:
(optional string)
Equivalent to the —from property in a COPY statement, use to specify an image to copy from. By default, the COPY source is the build environment’s file tree.
src:
(required string)
Path to source file or directory.
dest:
(required string)
Path to destination file or directory.