Using Docker
In this section, we will look at how to use Docker for day-to-day operations. Let’s understand the concepts that are talked about when using Docker – images and the container:
- Docker image: This image is a file that contains our application, including all the relevant operating system files.
- Container: The image file is read and executed by the Docker engine. Once it runs on the local machine it is called a container. You can interact with the container using the Docker command-line tools.
We will look at using Docker to download and run a simple Hello World application using the following command:
docker run hello-world
Open your terminal and run the following command:
$ docker run hello-world
This command will download the image file (if none exists locally) and execute it. You will then see the following message:
Unable to find image 'hello-world:latest' locally latest: Pulling from library/hello-world 2db29710123e...