For those who want to build and run Docker-containers in CentOS-7 – first of all, it is necessary to install the Docker itself.
To install the latest version of Docker and be able to update it in the future without any problems – it is recommended to install Docker from the official repository.
Tip: Install Docker on Ubuntu 16.04 Xenial Xerus Read More →
In this tutorial, I’ll show you how to install a free Docker CE (Community Edition) in CentOS-7 from a stable official repository, how to make sure that it is installed correctly and that you usually need to do after installation.
Requirements: To install the Docker in CentOS 7 – you must have a 64-bit architecture and a Linux kernel version 3.10 or higher. Having executed
uname -r, it is possible to check up whether the system corresponds to the given requirements.
Installing the Docker in CentOS-7
Configure a stable Docker repository:
$ sudo yum-config-manager -add-repo https://download.docker.com/linux/centos/docker-ce.repo
Install the Docker:
$ sudo yum install docker-ce
Run the Docker:
$ sudo systemctl start docker
Make sure that the Docker is installed correctly by running the image
$ sudo docker run hello-world
Tip: Docker has been successfully installed! It’s time to launch the first Docker-container! Read More →
After installing the Docker, you need to do a few more things.
First of all, you need to configure the automatic launch of the Docker daemon when the system boots.
Run the following command to add the Docker to startup:
$ sudo systemctl enable docker
And secondly, so that each time you
dockerdo not type a command
sudo, add your user to the group
$ sudo usermod -aG docker $ USER
Information: To end the user’s binding to the group, log out and log back in.
To make sure that you can run
$ docker run hello-world
Join our reader's list to start receiving latest updates.
Get free Tech, Linux tips and resources delivered directly to your inbox.