What is the ADD instruction good for in Docker?
Experience Level: Senior
Tags: Docker
Answer
The ADD instruction copies new files, directories or remote file URLs from <src> and adds them to the filesystem of the image at the path <dest>.
Multiple <src> resources may be specified but if they are files or directories, their paths are interpreted as relative to the source of the context of the build.
Each <src> may contain wildcards and matching will be done using Go’s filepath.Match rules.
Example:
ADD hom* /mydir/
Related Docker job interview questions
What is the LABEL instruction good for in Docker?
Docker SeniorWhat is a difference between COPY and ADD instructions in Docker?
Docker SeniorWhat is the STOPSIGNAL instruction good for in Docker?
Docker SeniorWhat is the SHELL instruction good for in Docker?
Docker SeniorHow do ENTRYPOINT and CMD instructions interact?
Docker Senior