Enter Your Email Address to Watch This Lesson

Your link to unlock this lesson will be sent to this email address.

Unlock this lesson and all 1083 of the free egghead.io lessons, plus get Docker content delivered directly to your inbox!



Existing egghead members will not see this. Sign in.

Download and Remove Docker Images

1:15 Docker lesson by

Learn the basics of downloading and pulling Docker images from Docker Hub. Learn the difference between default tags and version specific tags. Also learn how to display all images, and different ways to remove images.


egghead.io comment guidelines

Avatar
egghead.io

Learn the basics of downloading and pulling Docker images from Docker Hub. Learn the difference between default tags and version specific tags. Also learn how to display all images, and different ways to remove images.

Avatar
Dean

Is there a difference from getting an image from dockerhub, between:

docker pull mongo
vs.
docker run mongo:tagName <----- (( I was shown this way by someone else )).

In reply to egghead.io
Avatar
Mark

docker run executes a docker pull if the image is not yet locally cached, then runs it. docker pull just downloads the image to the local cache, but doesn't run it.

In reply to Dean

Let's download our first image by typing docker pull mongo. This will download the image from the mongo repository. By default, docker pulls images from docker hub.

You can visit hub.docker.com to search through a list of available images. If no tag is provided, docker pulls images with the latest tag. Download a specific version of a docker image by appending a colon with a tag, or version to the end of the image name.

Let's download another image. Note that official docker images only have one name, while community submitted images are name spaced with a user name, and a slash. Let's see which images are downloaded into our machine by typing docker images.

We can see the images along with the tag, image ID, when they were created, and the size. To remove an image, type docker rmi, and then, the image name. You can also remove a specific tag by appending it to the image name.

Another way to remove an image is by the image ID. Note that you don't need to use the full ID, but just the first few letters as long as it has uniqueness between the other downloaded image IDs.

HEY, QUICK QUESTION!
Joel's Head
Why are we asking?