How to Install Docker on CentOS/Redhat 6
Docker is a tool which quickly lets you to create light weight VMS with your code and deploy it as fast as possible through different services in various containers. Docker consists of various type of Containers (Docker VM’s) and Docker Hub (Online Docker’s VM sharing service). From within docker we see whole system but from base machine we just see one process running for each docker instance. There is a very smooth way of working inside Docker containers in which a system is built in such a way that developers, testers and Administrators can work together to deploy a code in faster way.
Add the EPEL Repository
Docker is part of Extra Packages for Enterprise Linux (EPEL), which is a community repository of non-standard packages for the RHEL distribution. First, we’ll install the EPEL repository:
# rpm -iUvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
Then, as a matter of best practice, we’ll update our packages:
# yum update -y
Installation
Now let’s install Docker by installing the docker-io package on centos6:
# yum install docker-io -y
Once the installation completes, we’ll need to start the Docker daemon:
# /etc/init.d/docker start
And finally, lets add Docker to start when the server boots:
# chkconfig docker on
Download a Docker Container
Let’s begin using Docker! Download the ubuntu Docker Container:
# docker pull ubuntu
Run a Docker Container
Now, to setup a basic ubuntu container with a bash shell, we just run one command. docker run will run a command in a new container, -i attaches stdin and stdout, -t allocates a tty, and we’re using the standard ubuntu container.
# docker run -it ubuntu /bin/bash
Yup.!! You are inside container, now you can use shell to pass the commends.
To Exit from the container, you need to enter “exit” comment.
Note: Inside container, you always logged in as a root user.
There are many community containers already available, which can be found through a search. In the command below I am searching for the keyword centos:
# docker search Ubuntu
-------------------------------------------------------------------------------------------------------------------
I get the following error when i am listing the updates.Server is currently registered with ULN. Although its a warning, i do not want the below message displayed when i am issuing yum command.i found out subscription-manager plugin is loaded. How to disable subscription-manager plugin??
Loaded plugins: downloadonly, product-id, rhnplugin, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
add a comment
two solutions
- in the plugin configuration file disable pluginvim /etc/yum/pluginconf.d/subscription-manager.confenabled=0
- or register to the satellite
- does it work for RHEL 7.5 running on AWS ec2-instance as # subscription-manager register --auto-attach Registering to: subscription.rhsm.redhat.com:443/subscription Username: ashxxxxxx@abc.com Password: ashxxxxxx@abc.com cannot register with any organizations. – Ashish Karpe Jul 17 '18 at 11:44