How to install Docker on CentOS 7.6

CentOS 7.6 is a great operating system for Desktop and Server. But for me, it has better performance and more suitable for server use. I am currently building my personal home server using the latest version of CentOS 7.6. It is working pretty well now. Today, I want to add more functionality to my server by installing Docker.

Docker Community Edition (CE) version 18.0.9 is now available for download. In this article, I am going to show you how I build my Docker virtualization host using CentOS 7.

Hardware Configuration:

Currently, my server has the following specifications:

  • CPU: 4 cores AMD CPU
  • Memory: 8 GB
  • Hard Disk: 150 GB
  • 1 Gigabit LAN connection

In my case, this specification is good enough for a small personal server. I also have Oracle Database 18c XE installed on this system.

Install Docker CE on CentOS 7.6

Installing Docker CE on CentOS 7 is pretty easy and straight-forward. First, I always update my system.

su -
yum update

Now, setting up the repository

yum install -y yum-utils \
  device-mapper-persistent-data \
  lvm2
yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo

Now, install Docker with the yum install command

yum install docker-ce

Once the installation completes, run the Docker service and set to automatically start during system boot.

systemctl start docker
systemctl enable docker

At this point, Docker is up and running. It’s time to run a hello-world container.

docker run hello-world

If everything work well, it will return something like this:

[root@server oracle]# docker run hello-world
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
The Docker client contacted the Docker daemon.
The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/get-started/

Closing Word

With Docker installed on my CentOS system, I want to run several database systems such as PostgreSQL, MySQL and Microsoft SQL Server on top of it. And also maybe building my own docker images in the future. Thanks for reading this post. I hope you enjoy it and see you next time.

Be the first to comment

Leave a Reply

Your email address will not be published.


*