Superpower Image Organization in Docker

DockerBeginner
Practice Now

Introduction

In a world where superpowers are the norm, the Superhero Academy faces a major challenge. The academy's ability to store and manage superpower knowledge is threatened by a lack of organization in their virtual environment. The renowned professor of superpowers, Dr. VirtualMind, has been tasked with ensuring that all the superpower images in the Docker universe are efficiently listed and managed. As part of this task, students are required to demonstrate their proficiency in listing Docker images.

Listing Docker Images

In this step, you will be required to list Docker images and perform some specific tasks related to image management.

Tasks

  • List all Docker images currently available on the system.
  • Filter the images to display only those tagged with "latest". You can use this command format docker images --filter <filter_type>=<filter_scope> to filter images.
  • Sort the images by their creation date in descending order. You can use this command format docker images --format <format> | grep <condition> | sort <option> to sort images.

Example

After completing the tasks, the output of the Docker images listing should display the images fulfilling the provided criteria.

List the all images:

REPOSITORY                    TAG       IMAGE ID       CREATED         SIZE
ubuntu                        latest    e34e831650c1   2 weeks ago     77.9MB
jenkins/jenkins               latest    ca7cca8fa4b0   8 months ago    466MB
hello-world                   latest    d2c94e258dcb   8 months ago    13.3kB
gcr.io/k8s-minikube/kicbase   v0.0.37   01c0ce65fff7   12 months ago   1.15GB

Filter the images to display only those tagged with "latest":

REPOSITORY       TAG       IMAGE ID       CREATED        SIZE
ubuntu           latest    e34e831650c1   2 weeks ago    77.9MB
jenkins/jenkins  latest    ca7cca8fa4b0   8 months ago   466MB
hello-world      latest    d2c94e258dcb   8 months ago   13.3kB

Sort the images by their creation date in descending order:

ubuntu                        latest    2024-01-12 01:08:11 +0800 CST   77.9MB
jenkins/jenkins               latest    2023-05-24 03:54:22 +0800 CST   466MB
hello-world                   latest    2023-05-03 00:49:27 +0800 CST   13.3kB

Summary

In this challenge, the aim is to test the proficiency in Docker image management. The tasks are designed to enhance the understanding of listing, filtering, and sorting Docker images. This challenge provides an opportunity to reinforce the knowledge of Docker image management and its practical application in a real-world scenario.

✨ Check Solution and Practice