Docker Images
Last updated
Last updated
In Docker, everything is based on Images. An image is a combination of a file system and parameters. Let’s take an example of the following command in Docker.
The Docker command is specific and tells the Docker program on the Operating System that something needs to be done.
The run command is used to mention that we want to create an instance of an image, which is then called a container.
Finally, "hello-world" represents the image from which the container is made.
Now let’s look at how we can use the Ubuntu image available in Docker Hub to run Ubuntu on our Ubuntu machine. We can do this by executing the following command on our Ubuntu machine −
Note the following points about the above sudo command −
We are using the sudo command to ensure that it runs with root access.
Here, Ubuntu is the name of the image we want to download from Docker Hub and install on our Ubuntu machine.
─it is used to mention that we want to run in interactive mode.
/bin/bash is used to run the bash shell once Ubuntu is up and running.
To see the list of Docker images on the system, you can issue the following command.
TAG − This is used to logically tag images.
Image ID − This is used to uniquely identify the image.
Created − The number of days since the image was created.
Virtual Size − The size of the image.
The Docker images on the system can be removed via the docker rmi command.
This command is used see the details of an image or container.