• About Us
  • Privacy & Policy
HowTo's
  • Home
  • Commands
  • Linux
  • SCM
  • Git
  • Database
  • MySQL
  • Kubernetes
  • Docker
No Result
View All Result
  • Home
  • Commands
  • Linux
  • SCM
  • Git
  • Database
  • MySQL
  • Kubernetes
  • Docker
No Result
View All Result
HowTo's
No Result
View All Result
Home Docker

Listing Docker Images

July 8, 2024
in Docker, Docker Commands Examples, Docker Commands Tutorial, Docker Tutorial
A A
0
12
SHARES
112
VIEWS
Share on FacebookShare on Twitter

This post will cover topic related to ‘Listing Docker Images’ with multiple docker command examples and different scenerios. So this will help you to understand the command docker and options available in it. Also this post will explain you how to use docker command.

The docker images command is used to list all Docker images that are currently stored locally on your system. Docker images are snapshots or templates of Docker containers, containing everything needed to run a container based on the image.

Here are several examples demonstrating the usage of docker images:

Example 1: List all Docker images on the system.

    docker images
    

This command displays a table with information about each image, including the repository, tag, image ID, and size.

Example 2: List Docker images with detailed information (verbose output).

    docker images -a
    

Adding the -a flag shows all images, including intermediate images that are not tagged and are usually hidden.

Example 3: Filter Docker images by repository name.

    docker images nginx
    

This command filters images whose repository name contains “nginx”. It lists all images with “nginx” in their repository name.

Example 4: Show only the numeric IDs of Docker images.

    docker images -q
    

Using the -q flag outputs only the image IDs, which can be useful for scripting or automation tasks.

Example 5: Display Docker images in a specific format (using Go template).

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

This command customizes the output format to show only the repository name followed by the tag for each image.

Example 6: Sort Docker images by creation date.

    docker images --format "table {{.Repository}}\t{{.Tag}}\t{{.CreatedAt}}\t{{.Size}}" | sort -k 3
    

Here, images are sorted based on their creation date, with the oldest images displayed first.

Example 7: Display total disk space used by Docker images.

    docker images --format "{{.Size}}" | awk '{sum+=$1} END {print sum}'
    

This command calculates and prints the total size of all Docker images currently stored on the system.

Example 8: List Docker images by filtering dangling images.

    docker images --filter "dangling=true"
    

Using the --filter flag with "dangling=true" filters images that have no associated containers and are not tagged.

Example 9: Display the image history for a specific Docker image.

    docker history nginx:latest
    

This command shows the history of layers that make up the nginx:latest image, detailing each layer’s creation and size.

Example 10: Show Docker images in a tree-like structure.

    docker images --tree
    

This experimental command displays Docker images in a hierarchical tree format, showing their relationships and dependencies.

To verify whether the docker images command executed successfully, check the terminal or command prompt output. If the command runs without errors and displays a list of Docker images along with their details, it indicates that the command executed as expected.

Also check similar articles.

Uploading Docker Images to a Registry
Downloading Docker Images from a Registry
Building Docker Images from a Dockerfile
Listing Docker Containers
Executing Commands Inside Docker Containers

Tags: DockerDocker Commands ExamplesDocker Commands TutorialDocker Tutorial
Previous Post

Uploading Docker Images to a Registry

Next Post

Logging in to Docker Registries

Related You may like!

howto

Managing Swarm Services

August 21, 2024
howto

Managing Docker Volumes

August 21, 2024

Managing Docker Networks

August 21, 2024

Managing Swarm Secrets

July 8, 2024

Managing Swarm Nodes

July 8, 2024

Managing Swarm Configurations

July 8, 2024
Next Post
howto

Logging in to Docker Registries

howto

Logging out from Docker Registries

howto

Searching Docker Hub for Images

Discussion about this post

Latest Updated

howto

How to Use -iname for Case-Insensitive Filename Searches in find

August 21, 2024
howto

Search for Files with Case-Insensitive Pattern Matching Using -ilname in find

August 21, 2024
howto

Find Files by Group Name with -group in find Command

August 21, 2024
howto

Locate Files by Group ID Using -gid in find Command

August 21, 2024
howto

How to Search for Filesystems with -fstype in find Command

August 21, 2024

Trending in Week

  • howto

    Using BTRFS Subvolume for User Home Directory in Linux

    22 shares
    Share 9 Tweet 6
  • Downloading Docker Images from a Registry

    13 shares
    Share 5 Tweet 3
  • Configuring SSL Connection Mode in mysqldump

    17 shares
    Share 7 Tweet 4
  • Omit Tablespace Information in mysqldump Output

    13 shares
    Share 5 Tweet 3
  • Setting MySQL Dump Compatibility Mode

    18 shares
    Share 7 Tweet 5
  • Setting Network Buffer Length in mysqldump

    13 shares
    Share 5 Tweet 3
  • Logging out from Docker Registries

    13 shares
    Share 5 Tweet 3
  • Using Extended INSERT Syntax in mysqldump

    12 shares
    Share 5 Tweet 3
  • Understanding Kubernetes API Resources with kubectl api-resources

    12 shares
    Share 5 Tweet 3
  • Setting Connection Protocol in mysqldump

    12 shares
    Share 5 Tweet 3
  • About Us
  • Privacy & Policy

© 2024 All Rights Reserved. Howto.swebtools.com.

No Result
View All Result

© 2024 All Rights Reserved. Howto.swebtools.com.