The instruction ADD
copies content, files, directories, or remote URL files from source and adds them to the file system of docker image at destination path.
ADD [--chown=<user>:<group>] <src>... <dest>
ADD [--chown=<user>:<group>] ["<src>",... "<dest>"]
Note: Here, --chown
feature is only for Linux containers, and it will not work for Windows.
ADD . /path/to/image/filesystem/
ADD clou* /cloudyfoxdir/
?
will replace any single character like cloudy.txt:ADD cloud?.txt /cloudyfoxdir/
Here, the destination is an absolute path or relative path to WORKDIR. Below is an example of a relative path and this will add cloudy.txt file to <WORKDIR>/relativeDir/
:
ADD cloudy.txt relativeDir/
Similarly, the following example uses an absolute path and adds cloudy.txt file to /absoluteDir/
:
ADD cloudy.txt /absoluteDir/