← Back to list

Quick Tips to Understand Docker: A Beginner’s Guide to Images, Containers, and Volumes

Docker

Fz Fawzi · 2024-06-06 23:24 · 0 claps · 2.5 min read
#docker #docker-image #volume
Open on Medium ↗
Wiki topics: ☁️ · DevOps & Cloud

Quick Tips to Understand Docker: A Beginner’s Guide to Images, Containers, and Volumes

Photo by Ian Taylor on Unsplash

Photo by Ian Taylor on Unsplash

Docker

Docker is a containerisation platform that enables you to create, deploy and run applications in containers. Containers are lightweight, isolated environments that share the kernel of the host operating system but have their own file systems, libraries and dependencies.

Docker Image

A Docker image is a read-only file containing everything an application needs to run: code, libraries, dependencies, configuration files, etc. Docker images are used to create Docker containers.

Characteristics of Docker Images:

  • Immutable: Once created, images cannot be modified. Any changes require creating a new image.
  • Layered: Docker images are built in layers. Each command in the Dockerfile (the configuration file used to create an image) creates a new layer.
  • Shareable: Images can be shared via Docker registries like Docker Hub, allowing other users to download and use them.

Docker Container

A Docker container is a running instance of a Docker image. Unlike images, containers are living entities that can be created, started, stopped, moved, and deleted.

Characteristics of Docker Containers:

  • Ephemeral: By default, containers are temporary. Changes made to containers do not persist after they are deleted, unless you use volumes or commit layers.
  • Isolated: Each container runs in its own isolated space, but they can interact with each other and with the host through networks and volumes.
  • Image-Based: A container is created from an image and adds a read-write layer on top of the image.

Docker Volume

A Docker volume is a storage method Docker uses to persist data generated and used by containers. Unlike data stored in container layers, which are deleted when the container is removed, volumes are managed by Docker and can persist beyond the life of containers.

Characteristics of Docker Volumes:

  • Data Persistence: Volumes allow data to be stored persistently, even after deleting a container. This is crucial for applications requiring data backup, such as databases.
  • Data Isolation: Volumes isolate data from the container lifecycle, allowing more flexible management of container updates without data loss.
  • Data Sharing: Volumes can be shared between multiple containers. For example, two containers can read and write to the same volume, facilitating collaboration between services.
  • Managed by Docker: Docker manages volumes, making them safer and easier to use than host directory mounts, especially in terms of permissions and security management.

Types of Storage in Docker:

  • Volumes: Managed by Docker, they are stored in a specific location on the host’s file system and can be used by multiple containers. Volumes are the recommended way to persist data in Docker.
  • Bind Mounts: Direct links between a directory or file on the host and a directory or file in the container. Bind mounts are less flexible and more likely to pose permission and security issues.
  • tmpfs Mounts: Temporary storage in RAM. Data in a tmpfs mount is lost when the container is stopped.

References and Useful Links

For further reading and deeper understanding, here are some recommended references and useful links:

  1. Docker Documentation: The official Docker Documentation provides comprehensive guides and tutorials on Docker concepts, installation, and usage.
  2. Docker Hub: Explore and share Docker images on Docker Hub.
  3. Docker Cheat Sheet: A handy Docker Cheat Sheet for quick reference.

YouTube Channels:

  1. Docker: The official Docker YouTube Channel features tutorials, demos, and webinars.
  2. TechWorld with Nana: This channel offers a great playlist on Docker basics and advanced topics. Check out TechWorld with Nana’s Docker Playlist.
  3. Traversy Media: For concise and practical tutorials, visit Traversy Media’s Docker Tutorials.
  4. Academind: Learn Docker step-by-step with detailed explanations on Academind’s YouTube Channel.

These resources will help you expand your knowledge and become more proficient with Docker.


메타데이터
post_id
eaeb110f3415
slug
quick-tips-to-understand-docker-a-beginners-guide-to-images-containers-and-volumes-eaeb110f3415
url
https://medium.com/@fzfawzi/quick-tips-to-understand-docker-a-beginners-guide-to-images-containers-and-volumes-eaeb110f3415
canonical_url
https://medium.com/@fzfawzi/quick-tips-to-understand-docker-a-beginners-guide-to-images-containers-and-volumes-eaeb110f3415
author_url
https://medium.com/@fzfawzi
status
ok
fetched_at
2026-07-23 16:52:19