Skip to main content
In this lesson, we’ll dive into Docker Hub and walk through essential image operations using both the web interface and Docker CLI. You’ll learn how to find, pull, tag, push, inspect, save, and remove images efficiently.

1. Exploring Docker Hub

Open your browser and go to hub.docker.com.
If you don’t have a Docker Hub account yet, sign up now—you’ll need it to push images later.
Docker Hub classifies images into three categories: Search for the Apache HTTP Server image (httpd) and click httpd. You’ll see:
  • Supported Tags: Available versions (e.g., latest, alpine).
  • Dockerfile links: How the image is built.
  • Quick info on architectures, update history, and help resources.
The image shows a webpage from Docker Hub, specifically the HTTPD repository, detailing quick reference information, supported tags, and Dockerfile links. It includes sections on where to get help, supported architectures, and image update details.

2. Listing and Pulling Images Locally

First, see which images are already on your host:
Sample output:
Pull the default HTTPD image (httpd:latest):
Verify it’s downloaded:

3. Searching Images via CLI

Instead of the web UI, search Docker Hub from your terminal:
To refine results:

4. Pulling Specific Tags and Tagging Images

Grab the Alpine-based HTTPD variant:
Verify both images:
Tag httpd:alpine locally:
Both tags share the same IMAGE ID and SIZE, since they reference the same layers.

5. Checking Disk Usage

Assess disk space consumed by images, containers, and volumes:

6. Pushing Images to Docker Hub

  1. Log in to Docker Hub:
  2. Retag your image with your Docker Hub username (replace <username>):
  3. Push the image:
If you try docker push httpd:kodekloudv1 without your username, you’ll get an “access denied” error. Always retag with your Docker Hub namespace.
After a successful push, confirm locally:
You should see:
On Docker Hub, navigate to your repositories to view it.

7. Removing Images

Locally

Remove a single tag:
If the image ID is still referenced by other tags, remove all of them:
Confirm removal:

On Docker Hub

  1. Sign in to Docker Hub and go to your account.
  2. Select the repository to delete.
  3. Click SettingsDelete Repository.
  4. Type the repository name to confirm.

8. Inspecting and Exploring Images

  • View an image’s layer history:
  • Inspect detailed metadata:

9. Saving and Loading Images

Export an image to a tarball:
Remove the local image:
Load it back:
This is useful for air-gapped or offline transfers.

10. Exporting and Importing a Container Filesystem

  1. Run a container:
  2. Export its filesystem:
  3. Import as a new image:
  4. Verify:

That covers image registry and operations with Docker Hub and CLI. Happy Dockering!

Watch Video