Docker Hello World

Learn via video courses
Topics Covered

Welcome aboard the Docker journey! This beginner-friendly guide dives into the essentials, explaining key concepts and guiding you through installation on Linux, Windows, and macOS.

Docker empowers developers. It tackles common challenges and streamlines the software development cycle, making it an invaluable tool for your arsenal.

Ready to set sail? We'll start with a classic "Hello World" example to introduce you to the basics. Buckle up and let's get building!

Prerequisite

A basic level of understanding of OS and containerization is required to fully understand the concepts explained during 'docker hello world'.

Basic Terminologies

A lot of different objects work together to run an application inside Docker. An application requires objects such as - Docker Images for the application code, Docker Containers to run the application, and Docker Registries to save and download Docker Images.

Docker Container

It is the place where the docker runs an image. You can think of it in this way as well for simplicity: Images become containers when they run on Docker Engine.

Docker Image

It is a lightweight, executable package that consists of everything needed to run an application: code, libraries, third-party dependencies, environment variables, and configurations.

Dockerfile

It is a document that consists of all the commands a user wants to call on the command line to build an image.

Docker Installation in CentOS/Redhat

To be able to run the Docker Engine, you'll need to have a supported version of CentOS. The latest version is recommended.

In order to install the engine, we'll first set up the docker repository and then use the repository to install the docker engine.

Repository Setup

Below commands would install the yum-utils package and set up the repository.

Installation of Engine

The below command would install the latest version of Docker Engine, containers, and Docker Compose.

Note If prompted to accept the GPG key, verify that the fingerprint matches 060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35, and if so, accept it.

Start and enable the docker services

Docker has been installed, but it hasn't been started yet. Let's start it.

Pull the hello-world image

Let's verify if the engine is able to pull an image by running the below command.

Execute Hello world

Let's verify if the engine is able to run a container by running the below command.

Conclusion

Great work! You have successfully understood the steps around installing docker and running containers on it. In the upcoming articles, we will dive deeper into the world of Docker.