How to Install Docker on CentOS 7 & RHEL 7
Docker is a container-based application framework, which wraps a specific application with all its dependencies in a container. Docker containers can easily ship to a remote location on start there without making the entire application setup. This tutorial will help you to install and manage Docker on CentOS/RHEL 7/6 operating system.
Step 1 – Verify Requirements
For a standard installation, Docker required a 64-bit operating system having Kernel >= 3.10 version. Older versions of Kernel have some missing requirements to run all features of Docker.
Also, install the following packages on your system.
Step 2 – Add Docker Yum Repository
Let’s add the official Docker yum repository to your system.
Step 3 – Install Docker on CentOS 7
After adding the yum repository to your CentOS system, update the yum cache by executing the following command.
Now install the docker community edition package to install docker on your system. This is installed in many of the required decencies on your system.
After successful installation of the Docker engine, Let’s start the docker service.
Then check the status of the Docker service.
Docker has been installed and running on your system. You can visit our Docker tutorial section to work with Docker containers.
How to Use Docker?
Search Docker Images
First of all search Docker container images from the Docker hub. For example, the below command will search all images with Ubuntu and list them as output
Download Docker Images
Now download the Docker container with the name Ubuntu on your local system using the following commands.
Now make sure that the above images have been downloaded successfully on your system. The below command lists all images.
Launch New Container with Image
Finally, launch a Docker container using the above-downloaded image on your system. The below command will start a new container and provide you access to that container with /bin/bash shell.
To exit from docker container type
After exiting from the Docker container, execute the below command to list all running containers.
By default Above command will list only running containers. To list all containers (including stopped containers) use the following command.
Start/Stop/Attach Container
You can start, stop or attach to any containers with the following commands. To start the container using the following command.
To stop the container use the following command.
To attach to the currently running container use the following command.
0 Comments
CAN FEEDBACK
Emoji