Dorokhov.codes

02. Creating images

Usually, Docker images are created using a Dockerfile.

To be able to create Docker images you should know how to use the next instructions:

COPY

COPY [--chown=<user>:<group>] <src>... <dest>
# Copying files:
COPY home.txt /mydir/

# Copying a directory:
COPY folder /mydir/folder/

The path must be inside the context of the build.

If <src> is a directory, the entire contents of the directory are copied, including filesystem metadata.

If <src> is any other kind of file, it is copied individually along with its metadata. In this case, if ends with a trailing slash /, it will be considered a directory and the contents of will be written at that directory.

  1. Instruction FROM