admin/ March 14, 2016/ Docker, Linux/ 0 comments

Docker is container-based application framework, which wrap of a specific application with all its dependencies in a container. Docker containers can easily to ship to remote location on start there without making entire application setup. This tutorial will help you to install and manage Docker on CentOS/RHEL 7/6 operating system.

1. Verify Requirements

For standard installation Docker required 64 bit operating system having Kernel >= 3.10 version. Older versions of Kernel have some missing requirements to run all features of Docker.

2. Add Docker Yum Repository

Let’s add the Docker yum repository on your system. Create a new yum configuration file/etc/yum.repos.d/docker.repo

and following contents.

3. Install Docker

First update all packages on your system using following command.

Now install docker-engine package to install docker on your system. This is install many of required decencies on your system.

After successful installation of Docker engine, Let’s start the docker service.

4. Manage Docker Container

Search Docker Images

First of all search Docker container images from Docker hub. For example, below command will search all images with Ubuntu and list as output

Download Docker Images

Now download the Docker container with name Ubuntu on your local system using following commands.

Now make sure that above images has been downloaded successfully on your system. Below command list all images.

Launch New Container with Image

Finally launch a Docker container using above downloaded image on your system. Below command will start a new container and provide you access of that container with /bin/bash shell.

To exit from docker container type CTRL + P + Q. This will leave container running in background an provide you host system console. If you used exit command, it will stop the current container.

After existing from Docker container, execute below command to list all running containers.

By default Above command will list only running containers. To list all containers (including stopped container) use following command.

Start/Stop/Attach Container

You can start, stop or attach to any containers with following commands. To start container use following command.

To stop container use following command.

To attach to currently running container use following command.

Leave a Reply

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