Zoomtutorials
  • Tutorials
    • DevOps
      • Terraform
      • Git
      • GitHub
      • Jenkins
      • Docker
      • Kubernetes
      • Ansible
      • Python
      • Azure DevOps
      • AWS DevOps
    • Cloud
      • AWS
      • Azure
      • GCP
      • Oracle Cloud
      • Alibaba Cloud
      • IBM Cloud
      • DigitalOcean
      • Linode
    • Microsoft Dynamics ERP
      • Dynamics 365
        • D365 FnO
        • D365 BC
      • Dynamics AX
      • Dynamics NAV
      • Dynamics GP
      • Dynamics CRM
    • Azure DevOps
      • Azure Boards
      • Azure Repos
      • Azure Pipelines
      • Azure Test Plans
      • Azure Artifacts
      • Extensions Marketplace
    • AWS DevOps
      • CodeStar
      • CodeCommit
      • CodeBuild
      • CodeDeploy
      • CodePipeline
      • CodeArtifact
    • Web Server
      • IIS
      • Apache
      • NGINX
      • Tomcat
      • NodeJS
    • Microsoft
      • Office 365
      • Microsoft 365
      • SharePoint
      • MS Dynamics ERP
  • Development
    • Application
      • Magento 2
      • Magento
      • WordPress
      • PHP
      • .Net
      • .Net Core
      • NodeJS
      • JAVA
    • Database
      • Microsoft SQL Server
      • MySQL
      • MariaDB
      • Amazon Aurora
      • SQL Proxy
  • HowTos
    • Linux OS
      • RHEL
      • Ubuntu
      • CentOS
      • Fedora
      • Debian
    • Linux Tips
      • Linux Commands
      • Linux Tricks
      • Linux Cheatsheet
    • Windows OS
      • Server 2019
      • Server 2016
      • Server 2012
      • Server 2008
      • Windows 11
      • Windows 10
      • Windows 8
      • Windows 7
    • Windows Tips
      • Windows Commands
      • Windows Shortcuts
  • Tools
    • Monitoring
      • New Relic
      • ELK Stack
    • Security
      • Firewall
      • Internet Security
      • Antivirus
    • Backup
      • SQL Backup
      • Iperius Backup
  • Courses
  • News
  • Submit Tutorials
  • More…
    • Services
    • Write For Us
    • Hire Us
    • Community
    • Donate ❤️
    • Contact Us
Facebook Twitter Instagram
Zoomtutorials
  • Tutorials
    • DevOps
      • Terraform
      • Git
      • GitHub
      • Jenkins
      • Docker
      • Kubernetes
      • Ansible
      • Python
      • Azure DevOps
      • AWS DevOps
    • Cloud
      • AWS
      • Azure
      • GCP
      • Oracle Cloud
      • Alibaba Cloud
      • IBM Cloud
      • DigitalOcean
      • Linode
    • Microsoft Dynamics ERP
      • Dynamics 365
        • D365 FnO
        • D365 BC
      • Dynamics AX
      • Dynamics NAV
      • Dynamics GP
      • Dynamics CRM
    • Azure DevOps
      • Azure Boards
      • Azure Repos
      • Azure Pipelines
      • Azure Test Plans
      • Azure Artifacts
      • Extensions Marketplace
    • AWS DevOps
      • CodeStar
      • CodeCommit
      • CodeBuild
      • CodeDeploy
      • CodePipeline
      • CodeArtifact
    • Web Server
      • IIS
      • Apache
      • NGINX
      • Tomcat
      • NodeJS
    • Microsoft
      • Office 365
      • Microsoft 365
      • SharePoint
      • MS Dynamics ERP
  • Development
    • Application
      • Magento 2
      • Magento
      • WordPress
      • PHP
      • .Net
      • .Net Core
      • NodeJS
      • JAVA
    • Database
      • Microsoft SQL Server
      • MySQL
      • MariaDB
      • Amazon Aurora
      • SQL Proxy
  • HowTos
    • Linux OS
      • RHEL
      • Ubuntu
      • CentOS
      • Fedora
      • Debian
    • Linux Tips
      • Linux Commands
      • Linux Tricks
      • Linux Cheatsheet
    • Windows OS
      • Server 2019
      • Server 2016
      • Server 2012
      • Server 2008
      • Windows 11
      • Windows 10
      • Windows 8
      • Windows 7
    • Windows Tips
      • Windows Commands
      • Windows Shortcuts
  • Tools
    • Monitoring
      • New Relic
      • ELK Stack
    • Security
      • Firewall
      • Internet Security
      • Antivirus
    • Backup
      • SQL Backup
      • Iperius Backup
  • Courses
  • News
  • Submit Tutorials
  • More…
    • Services
    • Write For Us
    • Hire Us
    • Community
    • Donate ❤️
    • Contact Us
Facebook Twitter Instagram YouTube LinkedIn
Zoomtutorials
Home»DevOps»How to install Docker and Docker Compose on CentOS 7
DevOps

How to install Docker and Docker Compose on CentOS 7

Choudhury SBy Choudhury SJune 26, 2019Updated:September 28, 2019No Comments3 Mins Read
Facebook Twitter Pinterest LinkedIn Tumblr Email
Share
Facebook Twitter LinkedIn Pinterest Email

Docker is a set of coupled software-as-a-service and platform-as-a-service products that use operating-system-level virtualization to develop and deliver software in packages called containers. The software that hosts the containers is called Docker Engine.

Containers are isolated from each other and bundle their own software, libraries and configuration files; they can communicate with each other through well-defined channels. All containers are run by a single operating-system kernel and are thus more lightweight than virtual machines. Containers are created from images that specify their precise contents. Images are often created by combining and modifying standard images downloaded from public repositories.

Step 1 — Install Docker

Before we install Docker, let’s first update all packages:

$ yum update

Install dependencies:

$ yum install -y yum-utils device-mapper-persistent-data lvm2

Configure the docker-ce repo:

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

Install docker-ce:

$ yum install docker-ce

Add your user to the docker group:

$ usermod -aG docker $(whoami)

Set Docker to start automatically at boot time:

$ systemctl enable docker

Start the Docker service:

$ systemctl start docker

Verify status of Docker service:

$ systemctl status docker

Step 2 —Check Docker version

To test the version of docker installed, run below command:

# docker --version
Docker version x.x.x-ce, build xxxxxx

Run docker info (or docker version) to view more details of docker

# docker info

Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 17.12.0-ce
Storage Driver: overlay2
...

Step 3 —Test Docker installation

Test that your installation works by running the simple Docker image, hello-world:

# docker run hello-world

Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
ca4f61b1923c: Pull complete
Digest: sha256:ca0eeb6fb05351dfc8759c20733c91def84cb8007aa89a5bf606bc8b315b9fc7
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.
...

List the hello-world image that was downloaded to your machine:

# docker image ls

List the hello-world container (spawned by the image) which exits after displaying its message. If it were still running, you would not need the --all option:

# docker container ls --all

CONTAINER ID     IMAGE           COMMAND      CREATED            STATUS
54f4984ed6a8     hello-world     "/hello"     20 seconds ago     Exited (0) 19 seconds ago

Summary of docker commands used in our tutorial.

## List Docker CLI commands ##
docker
docker container --help

## Display Docker version and info ##
docker --version
docker version
docker info

## Execute Docker image ##
docker run hello-world

## List Docker images ##
docker image ls

## List Docker containers (running, all, all in quiet mode) ##
docker container ls
docker container ls --all
docker container ls -aq

Step 4 — Install Docker Compose

Install dependencies for Docker Compose:

$ yum install epel-release

Install python-pip:

$ yum install -y python-pip

Next, install Docker Compose:

$ pip install docker-compose

Upgrade Python packages:

$ yum upgrade python*

Verify the Docker Compose installation:

$ docker-compose version

This completes the Docker and Docker-Compose installation tutorial. Enjoy your Docker journey!

devops docker docker-compose
Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
Choudhury S
  • Website

Choudhury is the founder and chief editor of ZoomTutorials Blog, a leading tutorials and technology blogging site specializing in DevOps, SysAdmin and Cloud Technologies to help IT professionals in their day to day work. He is a Senior Cloud and DevOps Solutions Engineer at a leading eCommerce development Company and has more than 10+ years of Cloud, DevOps and SysAdmin experience working with Fortune 500 companies to solve their most important IT backbones. He lives in Hyderabad with his wife and a son.

Related Posts

Git Commands for developers and sysadmins

July 25, 2021

Install the git credential-oskeychain

July 25, 2021

Install Git on Windows, Linux and Mac

July 2, 2021
0 0 votes
Article Rating
Subscribe
Notify of
guest
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments

Buy Me a Coffee Plz...

Get our latest tutorials
Recent Posts
  • How to Use the slmgr Command in Windows
  • How To Extend Windows Server Evaluation after Trial Period Expiry
  • List of Useful Magento 2 Commands
  • Magento 2 Commands and the Use Cases
  • MySQL and MariaDB Performance Tuning and Optimization
  • Microsoft Dynamics AX End of Support/Life
  • Magento Community read/write splitting with Database Proxy
  • Git Commands for developers and sysadmins
  • Install the git credential-oskeychain
  • Install Git on Windows, Linux and Mac
June 2022
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
27282930  
« Aug    
Archives
Site Statistics
  • Visitors today : 8
  • Page views today : 9
  • Total visitors : 11,786
  • Total page view: 12,651
svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMSAxJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnPjwvc3ZnPg== - How to install Docker and Docker Compose on CentOS 7
Facebook Twitter Instagram YouTube LinkedIn
  • Donation ❤️
  • About
  • Services
  • Submit Tutorials
  • Contact Us
  • Privacy Policy
  • Terms of Use
Copyright © 2017- 2022 by Zoomtutorials.com. All Rights Reserved. Designed with ❤️ by CloudSols.com

Type above and press Enter to search. Press Esc to cancel.

wpDiscuz