Installing Docker on CentOS 6 after removal of docker-io
Asked Answered
M

6

11

For some time, the docker-io package has been used to install Docker on CentOS 6.

Since early this month, this package no longer appears to be available:

[[email protected]:0 yum.repos.d]# yum install docker-io
Loaded plugins: fastestmirror, presto
Setting up Install Process
Determining fastest mirrors
 * base: mirror.intergrid.com.au
 * extras: mirror.ventraip.net.au
 * updates: mirror.ventraip.net.au
base                                                                 | 3.7 kB     00:00
base/primary_db                                                      | 4.7 MB     00:00
epel                                                                 | 4.7 kB     00:00
epel/primary_db                                                      | 6.0 MB     00:00
extras                                                               | 3.4 kB     00:00
extras/primary_db                                                    |  28 kB     00:00
updates                                                              | 3.4 kB     00:00
updates/primary_db                                                   | 3.2 MB     00:00
No package docker-io available.
Error: Nothing to do

docker-io was previously part of the epel repository and has been the recommended way to install Docker (albeit, an older version) on CentOS 6 in a number of places.

Is there any other way Docker can be installed on CentOS 6?

Micamicaela answered 13/3, 2019 at 4:3 Comment(0)
M
9

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
Micamicaela answered 13/3, 2019 at 4:3 Comment(6)
Are you sure that is exactly the same previously-available version? My yum says it has 1.7.1-2.el6, and your link unfortunately doesn't install cleanly for me (it for some reason doesn't see dependencies in /usr/lib64??).Pastel
Hmm it installed cleanly for me, but that was on a fresh server. I don’t suppose it works if you change the version in the URL?Micamicaela
I had tried 1.7.1-2 (what yum reported I have on other machines from docker-io) and that gave 403 FORBIDDEN. But at your prompting, I tried wget https://get.docker.com/rpm/1.7.1/centos-6/RPMS/x86_64/docker-engine-1.7.1-1.el6.x86_64.rpm and that works. The release notes indicate it's probably worth editing the answer to the later point release, though I hope neither we nor others will be using RHEL6 much longer!Pastel
I'm very curious what prompted this weird change! You didn't mention it, but docker is still in EPEL, it's just called docker and is even older at v1.5-5...Pastel
This answer worked for me by adding --setopt=obsoletes=0 flag when running yum installation.Salliesallow
Yum fails during installation with - download.docker.com/linux/centos/6/x86_64/stable/repodata/…: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"Idol
D
13

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

Disaccord answered 20/9, 2019 at 23:26 Comment(2)
Note that on my machine, I also had to do yum install libcgroupGeomancer
https://yum.dockerproject.org/repo/main/centos/6/Packages/docker-engine-1.7.1-1.el6.x86_64.rpm is a dead link. Answer by Tim Malone has up-to-date url pattern.Reverential
M
9

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
Micamicaela answered 13/3, 2019 at 4:3 Comment(6)
Are you sure that is exactly the same previously-available version? My yum says it has 1.7.1-2.el6, and your link unfortunately doesn't install cleanly for me (it for some reason doesn't see dependencies in /usr/lib64??).Pastel
Hmm it installed cleanly for me, but that was on a fresh server. I don’t suppose it works if you change the version in the URL?Micamicaela
I had tried 1.7.1-2 (what yum reported I have on other machines from docker-io) and that gave 403 FORBIDDEN. But at your prompting, I tried wget https://get.docker.com/rpm/1.7.1/centos-6/RPMS/x86_64/docker-engine-1.7.1-1.el6.x86_64.rpm and that works. The release notes indicate it's probably worth editing the answer to the later point release, though I hope neither we nor others will be using RHEL6 much longer!Pastel
I'm very curious what prompted this weird change! You didn't mention it, but docker is still in EPEL, it's just called docker and is even older at v1.5-5...Pastel
This answer worked for me by adding --setopt=obsoletes=0 flag when running yum installation.Salliesallow
Yum fails during installation with - download.docker.com/linux/centos/6/x86_64/stable/repodata/…: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"Idol
W
2

You should install docker-engine from epel-release:

  1. 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
  1. 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

Winze answered 24/4, 2019 at 10:53 Comment(1)
The step by step instructions are fantastic, but the url is dead. @Tim Malone's URL still worksShang
H
2

Version 1.7.0 has a bug, preventing the docker daemon from starting on CentOS 6.x:

level=warning msg="Running modprobe bridge nf_nat failed with message: , error: exit status 1"
level=fatal msg="Error starting daemon: Error initializing network controller: Error creating default \"bridge\" network: operation not supported"

In order to fix use version 1.7.1:

yum install https://yum.dockerproject.org/repo/main/centos/6/Packages/docker-engine-1.7.1-1.el6.x86_64.rpm
Hourigan answered 6/10, 2019 at 4:12 Comment(0)
S
1

The latest docker engine's version for CentOS 6 is 1.7.1, and the available URL is https://get.docker.com/rpm/1.7.1/centos-6/RPMS/x86_64/docker-engine-1.7.1-1.el6.x86_64.rpm. Unfortunately, this rpm file can't be installed by the "yum install" command now. You can use the "rpm" command after downloading the file.

Libcgroup is needed by docker-engine, you can find it from https://vault.centos.org.

wget https://vault.centos.org/6.6/os/x86_64/Packages/libcgroup-0.40.rc1-12.el6.x86_64.rpm
sudo rpm -ivhf libcgroup-0.40.rc1-12.el6.x86_64.rpm
wget https://get.docker.com/rpm/1.7.1/centos-6/RPMS/x86_64/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
Seduction answered 22/1, 2021 at 8:58 Comment(3)
however your code may answer the questions, it is required to add some comments or description why people should use your commandsAedes
The url redirects to one script, that script use download.docker.com but in that site nothing with Centos6 only 7 and upperMisguidance
I have fixed the "docker-engine" file's URL. @DanielAntonioNuñezCarhuayoSeduction
P
0

Can use this url https://mirrors.tuna.tsinghua.edu.cn/docker/yum/repo/centos6/Packages/ and choose the version of docker-engine rpm x86-64 for download

Then, you can do some like this:

sudo yum install localinstall docker-engine-1.7.1-1.el6.x86_64.rpm
Palpate answered 24/1, 2021 at 3:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.