🪟 Windows TippsThe Gemini desktop app is now available for Windows(11.09.2026 um 17:06 Uhr)
🪟 Windows TippsAnnouncing new builds for 11 September 2026(11.09.2026 um 19:11 Uhr)
🪟 Windows TippsChild account not showing in Microsoft Family(11.09.2026 um 11:11 Uhr)
🪟 Windows TippsUnable to connect to localhost MySQL workbench(11.09.2026 um 14:07 Uhr)
⚠️ Malware / Trojaner / VirenWindows 11 just dropped the tool ransomware abused, Microsoft says don’t restore WMIC(10.09.2026 um 20:11 Uhr)
🪟 Windows TippsThe Gemini desktop app is now available for Windows(11.09.2026 um 17:06 Uhr)
🪟 Windows TippsAnnouncing new builds for 11 September 2026(11.09.2026 um 19:11 Uhr)
🪟 Windows TippsChild account not showing in Microsoft Family(11.09.2026 um 11:11 Uhr)
🪟 Windows TippsUnable to connect to localhost MySQL workbench(11.09.2026 um 14:07 Uhr)
⚠️ Malware / Trojaner / VirenWindows 11 just dropped the tool ransomware abused, Microsoft says don’t restore WMIC(10.09.2026 um 20:11 Uhr)

🔧 Programmierung 🕛 vor 2 Jahren 6 Min Lesezeit
0

Chapter 2 - Docker Images

↗ Quelle (dev.to)
🗣️ Stimme:
📑 Inhaltsübersicht




Table of Contents




  • Introduction


  • What is a Docker Image?


    • Understanding Images as Templates for Containers








  • Working with Images


    • Pulling Images from Docker Hub: docker pull

    • Listing Images: docker images

    • Viewing Detailed Information About an Image: docker image inspect

    • Viewing the History of an Image: docker image history

    • Removing Images: docker rmi






  • Conclusion







Introduction



In this chapter, we will dive into the concept of Docker images. Understanding Docker images is fundamental to working with Docker, as images serve as the templates or blueprints for creating containers. We'll cover what Docker images are, how they work, and how to manage them using various Docker commands.






What is a Docker Image?



A Docker image is a lightweight, standalone, and executable package that includes everything an application needs to run, such as code, libraries, dependencies, and settings. It's a template for containers, allowing you to create multiple containers from a single image. Let's breakdown this definition of a Docker image by explaining the meaning of some key terms:




  • Stand-alone: A Docker image is a self-contained unit that doesn't rely on external dependencies or libraries to function. It has everything it needs to run, making it a standalone package.


  • Executable: A Docker image is executable because it can be run directly, without the need for additional compilation or interpretation.


  • Code: This refers to the application code, such as Go, Python, Java, or Node.js, that is packaged inside the Docker image.


  • Libraries: Libraries are pre-written code that provides common functionality, such as data encryption or networking. Docker images often include libraries that the application code relies on.


  • Dependencies: Dependencies are external libraries or services that the application code requires to function. Docker images can include these dependencies, making it easy to manage and deploy applications.


  • Settings: Settings refer to the configuration options, environment variables, and other parameters that are used to customize the application or service running inside the Docker image. These settings can be defined during the image build process or when creating a container from the image.







Understanding Images as Templates for Containers



Think of a Docker image as a blueprint or a template for creating containers. When you create a container from an image, Docker uses the image as a starting point and adds a read-write layer on top, allowing you to make changes to the container without modifying the original image. This process is called containerization.



In the explanation above, we mentioned that Docker adds a read-write layer to images. Let's breakdown what that means:




  • When you create a container from an image, Docker uses the image as a starting point. Docker then adds a thin, writable layer on top of the image. This layer is called the "container layer" or "read-write layer".



  • This read-write layer is where you can make changes to the container's filesystem, such as:




    • Creating new files

    • Modifying existing files

    • Deleting files

    • Installing new packages








The read-write layer is stored separately from the original image, which remains unchanged. By using a read-write layer, Docker allows you to make changes to the container without modifying the original image. This provides several benefits, such as:




  • You can create multiple containers from the same image and customize each

    one independently.


  • You can make changes to a container without affecting other containers

    created from the same image.


  • You can easily revert to the original image if needed.




Another important point to note about Docker Images is that they are made up of layers, like a stack of building blocks. Each layer represents a set of changes to the filesystem. This means that multiple images can share common layers, making storage more efficient and reducing duplication.






Working with Images






Pulling Images from Docker Hub: docker pull



To use a Docker image, you need to pull it from Docker Hub, a cloud-based registry service that allows you to store and share images. It is the default repository for Docker images.



To pull an image from Docker Hub, use the docker pull command:




CODE
docker pull <image_name>:<tag>






For example, to pull the latest Ubuntu image, you would use:




CODE
docker pull ubuntu:latest






NB: If you don't specify a tag, Docker will pull the latest tag by default.






Listing Images: docker images



To list all the Docker images on your local machine, use the docker images command:




CODE
docker images






This command provides a table of available images, showing details such as the repository name, tag, image ID, creation date, and size.






Viewing Detailed Information About an Image: docker image inspect



To view detailed information about a Docker image, use the docker image inspect command followed by the image name or ID.




CODE
docker image inspect <image_name_or_id>






For example, to inspect the Ubuntu image you pulled earlier, use:




CODE
docker image inspect ubuntu:latest






This command will display detailed information about the ubuntu:latest image, including its architecture, operating system, and layers.






Viewing the History of an Image: docker image history



To view the history of a Docker image, use the docker image history command followed by the image name or ID.




CODE
docker image history <image_name_or_id>






For example, to view the image history of the Ubuntu image you pulled earlier, use:




CODE
docker image history ubuntu:latest






This command will display a list of layers that make up the ubuntu:latest image, including the commands that were run to create each layer.






Removing Images: docker rmi



Be careful when removing images, as this will also remove any containers created from that image. To remove an image from your local machine, use the docker rmi command followed by the image ID or repository name and tag:




CODE
docker rmi <image_name>:<tag>






For example, to remove the Ubuntu image you pulled earlier, use:




CODE
docker rmi ubuntu:latest






NB: If the image is being used by any containers, you will need to stop and remove those containers first.






Conclusion



Docker images are the foundation of containerized applications, providing a reproducible and portable environment for running software. In this chapter, we covered what Docker images are, how they function as templates for containers, and essential commands for managing images. Mastering these basics will enable you to efficiently use Docker for your DevOps needs.



Feel free to leave comments and share this article. Follow my blog for more insights on Docker and DevOps!

Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
2 Quellen
The Gemini desktop app is now available for Windows
1 Quelle
Seamlessly import your team and data from Microsoft to Google Workspace during setup
1 Quelle
Announcing new builds for 11 September 2026
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Chapter 2 - Docker Images

Thematisch verwandte Begriffe: Chapter, Docker, Images · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...