Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • DSA
  • Practice Problems
  • C
  • C++
  • Java
  • Python
  • JavaScript
  • Data Science
  • Machine Learning
  • Courses
  • Linux
  • DevOps
  • SQL
  • Web Development
  • System Design
  • Aptitude
  • GfG Premium
Open In App
Next Article:
Docker - Hello World
Next article icon

Docker - Hello World

Last Updated : 04 Aug, 2021
Comments
Improve
Suggest changes
Like Article
Like
Report

Have you ever experience that in just one second your entire operating system is ready to use?

Yes, you heard it right Docker gives you the facilities to use a new operating system in one second. Docker is a program that uses your base OS resources and only consumes 20MB - 50MB RAM to launch a new OS. In this article, we'll show you how to install the docker inside Redhat Linux, how to start docker services, how to pull images from the docker hub, and finally how to launch a new container.

In this article, we will discuss the "Hello World" for Docker.

These are the steps to achieve the goal.

  1. Basic terminologies like docker container, docker image, dockerfile.
  2. Docker installation on Redhat/centos.
  3. How to start docker services.
  4. How to pull Hello-world image from docker hub.
  5. Hello-world.

Let's start with the key terminologies that you must know.

Basic terminologies

1. Docker container

Docker container is a separate virtualized environment that is used to test, run and deploy the applications. basically, the docker container is used in application development. If any problem or bug comes then it does not affect our Base OS and it also gives extra security. we can easily create new containers with help of docker images. we can also destroy these containers easily.

2. Docker image

Docker images are like snapshots in VMs. Docker images are executable files that are used to create separate containers in Docker. We create lots of containers using single docker images. Docker hub is a centralized location that is maintaining docker images. You can find Docker images of Hello-world, Ubuntu, Centos, etc. We also create our own customize image using the docker commit command and using Dockerfile and publish or push them on the docker hub.

3. Dockerfile

Dockerfile is a scripted text file that is used to customize our container and install desire software inside the docker container. we just write the commands in Dockerfile and using this file we build our own image. Later we use this image in our container as well as we push the image on Dockerhub.

Docker installation in centos/Redhat

As we discuss earlier Dockerhub has the Hello-world official image so let's see how to install docker and create containers. First of all, we configure a repo that has docker-ce software using the following command:

sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

After the repository add you can check the repo in (/etc/yum.repos.d/) location. Now you can easily download the docker using the yum command:

sudo yum install docker

Just in your case if the above command gives some error then try the below command

sudo yum install docker-ce --nobest

Start and enable the docker services:

Use the below commands to enable and start docker respectively:

sudo systemctl enable docker  sudo systemctl start docker

Pull the hello-world image

Now pull the hello-world image from docker use the below command:

docker pull hello-world

Execute Hello world:

Use the below command to run the hello-world file in docker:

docker run hello-world

After running the above command you see some message that prints hello-world which means your docker is successfully installed in your Centos or Redhat Linux.

Hope you understand my explanation.Thanks for reading.


Next Article
Docker - Hello World

S

sahid1486
Improve
Article Tags :
  • Cloud Computing
  • Docker Container
  • docker

Similar Reads

    Docker - Toolbox
    Docker is a container platform that allows you to build, test and deploy applications quickly. A developer defines all the dependencies in a "docker file" which is used to build a Docker image that defines a docker container. Doing this ensures that your application will run in any environment. The
    9 min read
    Docker - WORKDIR Instruction
    In Docker, organizing and managing file paths within a container is key to building efficient and easy-to-maintain applications. One way to streamline this is by using the WORKDIR instruction in your Dockerfile. Setting the working directory helps control where commands run, making your Dockerfile m
    6 min read
    Features of Docker
    Pre-requisite: Docker Docker is one of the most popular open-source sets of platforms for developing and automating the deployment of applications. It deploys applications into containers and enables us to separate our applications from infrastructure. It is designed to provide a lightweight and fas
    4 min read
    What Docker Hostnames ?
    When it comes to the area of containerization, Docker has been a game changer as a tool to deploy, manage, and scale applications in lightweight, portable environments. Docker helps to simplify the building of applications together with their dependencies into containers which in turn allow for easy
    5 min read
    Docker exec
    In containerization, the `docker exec` command stands out as a powerful tool for interacting with running Docker containers. This article explores the capabilities and usage of `docker exec`, detailing how it facilitates seamless communication and control over containerized applications.Before tryin
    11 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences