Getting started with Docker doesn't have to feel overwhelming. Think of Docker as a tool that helps you "package once and run anywhere," making your applications more portable and reliable.
This beginner guide aims to provide an introduction to
docker and Docker Compose. I assume that you have docker on your Windows machine, if not, check this beautiful article by Joy Akinyi.
In this article i will provide a brief history,pro/cons and definitions of Docker and Docker Compose.
What is Docker ?
Docker is an open source platform that enables developers manage applications within containers. Containers are lightweight, isolated environment that package an application with its dependencies, providing consistent and reproducible deployments across different computing environments that have Docker installed. Docker allows developers to build, ship and run applications efficiently, regardless of the underlying infrastructure.
What is Docker Compose ?
Docker compose is a tool that allows you to define and run multi-container applications. With Docker Compose, you can create a YAML file which we will see ahead, that defines the services that make your application, and then use a single command to start all services.
docker-compose up
Docker and Docker Compose: A Brief History
Due to my deep passion for history lets briefly narrate the conception of Docker and Docker Compose,
Docker was first released in March 2013 by Solomon Hykes and his team at a company called dotCloud later renamed into Docker, Inc. In 2010 dotCloud was experimenting with Linux Containers (LXC) tech. They solved the teeth shattering statement "but it works in my machine" because applications behaved differently across environments.In March 2013 Docker was officialy released as an open source project at PyCon. In June 2013 its first version is released evolving to what it is today.
Docker Compose was introduced in 2014 as a separate project initially called “fig”, later becoming an official Docker tool. It was created to address the need for managing complex applications with multiple interconnected containers. Docker Compose emerged as a solution for orchestrating container-based applications, allowing developers to define and manage their dependencies easily.
Docker Key Terminologies
Image: A lightweight, standalone, executable package that contains everything needed to run an application, including the code, runtime, libraries and system tools.
Container: A container is a runnable instance of an image on the host machine. It is isolated from other containers and the host machine, and has its own filesystem, network process space.
Dockerfile: A docker file is a text file that contains the instructions for building a Docker image.
Registry: A centralized repository that stores Docker images, such as Docker Hub or private registries.
Docker Hub: This is the official registry for Docker images.
Volume: A persistent storage mechanism that allows data to be shared between containers or between a container and the host system.
Docker Compose Key Terminologies
Service: A definition that describes how to run a specific container, including its image, configuration, dependencies and networking requirements.
YAML Ain’t Markup Language (YAML): A human-readable data serialization format used by Docker Compose to define the application’s structure and configuration. I briefly talked about YAML files in my previous article, Getting Started with GitHub Actions: A Beginner’s Guide.
Volume: A mechanism to persist data across container restarts or between containers.
Network: A virtual network that allows containers within the same Docker Compose project to communicate with each other.
Docker Hub
Top comments (0)