Docker Images
Estimated reading: 3 minutes 32 views

πŸ“¦ How to See a List of Docker Images – A Complete Guide with Examples & FAQs


🧲 Introduction – Why Listing Docker Images Matters

When working with Docker, managing your local image inventory is essential. Whether you’re debugging issues, optimizing disk usage, or preparing deployments, listing available Docker images gives you control over what’s installed and what can be safely removed.

This guide will teach you how to:

  • πŸ“‹ List all Docker images on your system
  • 🧼 View intermediate/dangling layers
  • 🎯 Filter images by repository, tag, or image ID
  • βš™οΈ Format and script image outputs effectively

πŸ“¦ 1. Basic Listing of Docker Images

πŸ”Ή Command:

docker images

🧾 Example Output:

REPOSITORY    TAG       IMAGE ID       CREATED         SIZE
ubuntu        latest    a8780b506fa4   2 weeks ago     77.8MB
nginx         alpine    5e4e474fae03   3 weeks ago     23.5MB
python        3.9       5b3e8ce1a8d1   1 month ago     912MB

πŸ” Explanation of Columns:

ColumnMeaning
🏷️ REPOSITORYThe name of the image (e.g., ubuntu, nginx)
πŸ“Œ TAGVersion tag (e.g., latest, alpine, 3.9)
πŸ†” IMAGE IDUnique identifier for the image
πŸ“… CREATEDHow long ago the image was created
πŸ’Ύ SIZETotal disk space the image occupies

🧱 2. View All Images Including Intermediate Layers

πŸ”Ή Command:

docker images -a

πŸ”Ž Why It Matters:

Intermediate layers from image builds are typically hidden. Use -a to reveal all layers, including those without a repository or tag.

🧾 Sample Output:

<none>        <none>    3b1f3c7bc87c   4 weeks ago     120MB
ubuntu        latest    a8780b506fa4   2 weeks ago     77.8MB

🎯 3. Filter Images by Name or Tag

πŸ”Έ Filter by Image Name:

docker images nginx

πŸ”Έ Filter by Name and Tag:

docker images nginx:alpine

These are useful when you want to inspect a specific version or variant of an image.


πŸ“‹ 4. Image List Only with Image IDs (Quiet Mode)

πŸ”Ή Command:

docker images -q

🧠 Use Case:

Helpful when scripting batch removal or automated checks.

πŸ”Ž Output:

a8780b506fa4
5e4e474fae03
5b3e8ce1a8d1

🎨 5. Format Output for Simplicity

πŸ”Ή Show Just Name and Tag:

docker images --format "{{.Repository}}:{{.Tag}}"

🧾 Output:

ubuntu:latest
nginx:alpine
python:3.9

Custom formatting lets you control what data to extractβ€”ideal for readable logs or automation.


🧾 6. Format Images as a Table

πŸ”Ή Command:

docker images --format "table {{.ID}}\t{{.Repository}}\t{{.Tag}}\t{{.CreatedSince}}\t{{.Size}}"

πŸ“‹ Output:

IMAGE ID       REPOSITORY    TAG       CREATED         SIZE
a8780b506fa4   ubuntu        latest    2 weeks ago     77.8MB
5e4e474fae03   nginx         alpine    3 weeks ago     23.5MB

Cleanly displays your image list in a structured table, perfect for quick visual reviews.


πŸ“Œ Summary – How to see list of Docker Image

  • πŸ” Use docker images for a quick list of local images
  • 🎯 Add flags like -a or -q for more detail or script-friendly output
  • 🧹 Clean up with docker rmi and docker image prune
  • πŸ› οΈ Format output for CI/CD pipelines or auditing

βš™οΈ Knowing how to efficiently list and filter images helps you keep your Docker environment lean, clean, and ready for deployment.


❓ Frequently Asked Questions (FAQs)


How do I list image sizes only?

βœ… Use:

docker images --format "table {{.Repository}}\t{{.Tag}}\t{{.Size}}"

How can I find dangling (unused) images?

βœ… Run:

docker images -f "dangling=true"

🧹 To clean them up:

docker image prune

How do I search for a specific image locally?

βœ… Use:

docker images | grep "nginx"

Can I sort images by size or creation date?

βœ… Sort by size:

docker images --format "table {{.Repository}}\t{{.Size}}" | sort -k2 -h -r

βœ… Sort by date:

docker images --format "table {{.Repository}}\t{{.CreatedAt}}" | sort -k2 -r

How can I see image history?

βœ… Command:

docker history nginx:alpine

πŸ“‹ Shows image layer sizes and commands used to build them.


What’s the difference between docker images and docker image ls?

βœ… None. Both commands list local images. docker image ls is just the newer syntax.


Share Now :

Leave a Reply

Your email address will not be published. Required fields are marked *

Share

How to see list of Docker Image

Or Copy Link

CONTENTS
Scroll to Top