Running your first container
You create Docker containers out of Docker container images. While we will discuss container images and their architecture in the following chapters, an excellent way to visualize it is as a copy of all files, application libraries, and dependencies that would comprise your application environment, similar to a virtual machine image.
To run a Docker container, we will use the docker run
command, which has the following structure:
$ docker run [OPTIONS] IMAGE[:TAG|@DIGEST] [COMMAND] [ARG...]
Let's look at each of them using working examples.
In its simplest form, you can use docker run
by simply typing the following:
$ docker run hello-world Unable to find image 'hello-world:latest' locally latest: Pulling from library/hello-world 0e03bdcc26d7: Pull complete Digest: sha256:e7c70bb24b462baa86c102610182e3efcb12a04854e8c582 838d92970a09f323 Status: Downloaded newer image for hello-world:latest Hello from Docker! ...
If you remember...