Installing Docker on CentOS 6 after removal of docker-io
You should install docker-engine from epel-release:
- Add docker repository for installing latest copy of Docker for Centos 6
Update, install epel repo then create a repo called docker.repo and fill in the information for docker repo:
[user@docker7 ~]# sudo yum update -y
[user@docker7 ~]# sudo yum install epel-release
[user@docker7 ~]# sudo vi /etc/yum.repos.d/docker.repo
[docker-repo]
name=Docker Repo
baseurl=https://yum.dockerproject.org/repo/main/centos/$releasever/
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
- Install docker package, then enable the service to start upon reboot, also start the docker service.
Now install docker-engine and enable docker to start at boot with systemctl. Then enable docker command and also start docker with systemctl start docker
For centos 7
[user@docker7 ~]$ sudo yum install -y docker-engine
[user@docker7 ~]$ sudo systemctl enable docker
[user@docker7 ~]$ sudo systemctl start docker
[user@docker7 ~]$ sudo systemctl status docker
For centos 6
[user@docker7 ~]$ sudo chkconfig docker on
[user@docker7 ~]$ sudo service docker start
[user@docker7 ~]$ sudo service docker status
[user@docker7 ~]$ ps aux | grep docker
root 2382 0.3 1.4 498424 26536 ? Ssl 20:17 0:00 /usr/bin/dockerd
root 2385 0.0 0.2 263104 5568 ? Ssl 20:17 0:00 docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --state-dir /var/run/docker/libcontainerd/containerd --shim docker-containerd-shim --runtime docker-runc
3.Manage Docker as a non-root user
This version finally installed OK
wget https://yum.dockerproject.org/repo/main/centos/6/Packages/docker-engine-1.7.1-1.el6.x86_64.rpm
sudo rpm -ivhf docker-engine-1.7.1-1.el6.x86_64.rpm
sudo service docker start
System
Linux host.my-domain.com 2.6.32-431.17.1.el6.x86_64 #1 SMP Wed May 7 23:32:49 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
I'm not sure why docker-io
suddenly disappeared, but the same version previously available through the epel repository can be installed directly from this rpm hosted by Docker:
[root@server]# yum install
https://get.docker.com/rpm/1.7.1/centos-6/RPMS/x86_64/docker-engine-1.7.1-1.el6.x86_64.rpm
[root@server]# docker --version
Docker version 1.7.0, build 0baf609