Register to Better Coder! It's free.
Enjoy the premium features and succeed at every job interview.

What is the COPY instruction in Docker good for?

Experience Level: Senior
Tags: Docker

Answer

The COPY instruction copies new files or directories from <src> (build context) and adds them to the filesystem of the container at the path <dest>.

Example:
COPY file* /dest/

If the <dest> is a relative folder, it is relative to the current folder that is defined by WORKDIR instruction.

Comments

No Comments Yet.
Be the first to tell us what you think.
Docker instructions
Docker instructions

Are you learning Docker ? Try our test we designed to help you progress faster.

Test yourself