docker / for-linux

Docker Engine for Linux
https://docs.docker.com/engine/installation/
754 stars 85 forks source link

CentOS 7/RHEL 7 installations broken where $releasever is '7Server' #1111

Closed ineffyble closed 3 years ago

ineffyble commented 4 years ago

Expected behavior

yum install is able to install docker-ce from the repo provided at http://download.docker.com/linux/centos/docker-ce.repo when the $releasever variable is set to 7Server.

Actual behavior

At some point in the last week, this has stopped working, and https://download.docker.com/linux/centos/7Server is now a 404. I suspect this coincides with the release of the CentOS 8 packages.

https://download.docker.com/linux/centos/7 still exists, but that is not the same $releasever and so the repo reference in http://download.docker.com/linux/centos/docker-ce.repo is broken.

Steps to reproduce the behavior

Attempt to install Docker from the provided CentOS/RHEL repo with an installation of CentOS/RHEL that has 7Server set as the yum releasever.

gdhgdhgdh commented 4 years ago

This broke a bunch of deployments for us and caused much yak shaving today. I'd very much appreciate the 7Server being restored.

thaJeztah commented 4 years ago

Is this both on CentOS and RHEL machines? Does CentOS also set the Server suffix?

thaJeztah commented 4 years ago

I opened a PR with a workaround for our install script https://github.com/docker/docker-install/pull/194 (but for manual installations, something similar will have to be done);

If you're on RHEL7/CentOS7 and have this issue:

for channel in "stable" "test" "nightly"; do \
    yum-config-manager --setopt="docker-ce-${channel}.baseurl=https://download.docker.com/linux/centos/7/debug-\$basearch/${channel}" --save; \
    yum-config-manager --setopt="docker-ce-${channel}-debuginfo.baseurl=https://download.docker.com/linux/centos/7/debug-\$basearch/${channel}" --save; \
    yum-config-manager --setopt="docker-ce-${channel}-source.baseurl=https://download.docker.com/linux/centos/7/source/${channel}" --save; \
done

If you're on RHEL8/CentOS8 and have this issue:

for channel in "stable" "test" "nightly"; do \
    yum-config-manager --setopt="docker-ce-${channel}.baseurl=https://download.docker.com/linux/centos/8/debug-\$basearch/${channel}" --save; \
    yum-config-manager --setopt="docker-ce-${channel}-debuginfo.baseurl=https://download.docker.com/linux/centos/8/debug-\$basearch/${channel}" --save; \
    yum-config-manager --setopt="docker-ce-${channel}-source.baseurl=https://download.docker.com/linux/centos/8/source/${channel}" --save; \
done
andrewbanchich commented 4 years ago

I'm experiencing this on RHEL 7.7.

Running your workaround @thaJeztah gives me:

No package docker-ce available.
Error: Nothing to do
ghost commented 4 years ago

@andrewbanchich The work-around only works if you are using the CentOS version of Docker on RHEL. Red Hat no longer supports Docker so many people switched to using the CentOS version of Docker on RHEL.

Run the CentOS installation instructions on RHEL https://docs.docker.com/engine/install/centos/ But before you $ sudo yum install docker-ce docker-ce-cli containerd.io run the work-around.

One more thing. When switching to the Docker for CentOS watch out for https://github.com/docker/for-linux/issues/477

msbecker commented 4 years ago

I am getting the following error after running the workaround to fix the broken repo link.

sudo yum install docker-ce docker-ce-cli containerd.io Loaded plugins: langpacks, ulninfo docker-ce-stable | 3.5 kB 00:00:00 ksplice-uptrack | 951 B 00:00:00 ol7_UEKR5 | 2.5 kB 00:00:00 ol7_addons | 2.5 kB 00:00:00 ol7_developer | 2.5 kB 00:00:00 ol7_developer_EPEL | 2.7 kB 00:00:00 ol7_latest | 2.7 kB 00:00:00 ol7_optional_latest | 2.5 kB 00:00:00 ol7_software_collections | 2.5 kB 00:00:00 (1/2): docker-ce-stable/x86_64/updateinfo | 55 B 00:00:00 (2/2): docker-ce-stable/x86_64/primary_db | 6.4 kB 00:00:00 No package docker-ce available. No package docker-ce-cli available. No package containerd.io available. Error: Nothing to do

ghost commented 4 years ago

@msbecker "ol7" is Oracle Linux 7. Can you please share the output of yum repolist ? Thanks.

andrewbanchich commented 4 years ago

@mettacrawler I tried this on a clean RHEL 7.7 server and getting the same results.

When I run the workaround, it outputs

================================================ repo: rhui-rhel-7-server-rhui-rpms ================================================
[rhui-rhel-7-server-rhui-rpms]

followed by a bunch of vars to the console. Then I run the install command:

[ec2-user@ip~]$ sudo yum install docker-ce docker-ce-cli containerd.io
Loaded plugins: amazon-id, search-disabled-repos
docker-ce-stable                                                                                             | 3.5 kB  00:00:00
rhui-client-config-server-7                                                                                  | 2.1 kB  00:00:00
rhui-rhel-7-server-rhui-rh-common-rpms                                                                       | 2.1 kB  00:00:00
rhui-rhel-7-server-rhui-rpms                                                                                 | 2.0 kB  00:00:00
(1/2): docker-ce-stable/x86_64/updateinfo                                                                    |   55 B  00:00:00
(2/2): docker-ce-stable/x86_64/primary_db                                                                    | 6.4 kB  00:00:00
No package docker-ce available.
No package docker-ce-cli available.
No package containerd.io available.
Error: Nothing to do
ghost commented 4 years ago

@andrewbanchich Did you follow these instructions? https://docs.docker.com/engine/install/centos/

Run the CentOS installation instructions on RHEL https://docs.docker.com/engine/install/centos/ But before you $ sudo yum install docker-ce docker-ce-cli containerd.io run the work-around.

One more thing. When switching to the Docker for CentOS watch out for https://github.com/docker/for-linux/issues/477

andrewbanchich commented 4 years ago

Yes, I followed those instructions and did exactly that. Is the workaround supposed to output those var settings to the console?

ghost commented 4 years ago

Please try:

sudo yum-config-manager --setopt="docker-ce-stable.baseurl=https://download.docker.com/linux/centos/7/x86_64/stable" --save

Then sudo yum install docker-ce docker-ce-cli containerd.io

andrewbanchich commented 4 years ago

@mettacrawler After running both commands:

[ec2-user@ip ~]$ sudo yum install docker-ce docker-ce-cli containerd.io
Loaded plugins: amazon-id, search-disabled-repos
docker-ce-stable                                                                                             | 3.5 kB  00:00:00
rhui-client-config-server-7                                                                                  | 2.1 kB  00:00:00
rhui-rhel-7-server-rhui-rh-common-rpms                                                                       | 2.1 kB  00:00:00
rhui-rhel-7-server-rhui-rpms                                                                                 | 2.0 kB  00:00:00
docker-ce-stable/primary_db                                                                                  |  46 kB  00:00:00
Resolving Dependencies
--> Running transaction check
---> Package containerd.io.x86_64 0:1.3.7-3.1.el7 will be installed
--> Processing Dependency: container-selinux >= 2:2.74 for package: containerd.io-1.3.7-3.1.el7.x86_64
---> Package docker-ce.x86_64 3:19.03.13-3.el7 will be installed
--> Processing Dependency: container-selinux >= 2:2.74 for package: 3:docker-ce-19.03.13-3.el7.x86_64
---> Package docker-ce-cli.x86_64 1:19.03.13-3.el7 will be installed
--> Finished Dependency Resolution
Error: Package: 3:docker-ce-19.03.13-3.el7.x86_64 (docker-ce-stable)
           Requires: container-selinux >= 2:2.74
Error: Package: containerd.io-1.3.7-3.1.el7.x86_64 (docker-ce-stable)
           Requires: container-selinux >= 2:2.74
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

Update: If I do the follow then it works (again). Thanks @mettacrawler

sudo yum install -y http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.107-3.el7.noarch.rpm
sudo yum install -y https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm
sudo yum install -y docker-ce docker-ce-cli
ghost commented 4 years ago

@andrewbanchich I'm guessing you are stuck with RHEL 7.7 and can't switch to 7.8 for some reason, right?

andrewbanchich commented 4 years ago

@mettacrawler Correct. Actually I need to use this on 7.6, but I didn't think there would be a huge difference between dot releases.

ghost commented 4 years ago

@andrewbanchich please see https://access.redhat.com/solutions/5154

msbecker commented 4 years ago

Still pointing to wrong URL after running the fix from above.

@mettacrawler sudo yum repolist Loaded plugins: langpacks, ulninfo repo id repo name status docker-ce-stable/7Server/x86_64 Docker CE Stable - x86_64 17 ksplice-uptrack/7Server/x86_64 Ksplice Uptrack for Oracle Linux 18 nodesource/x86_64 Node.js Packages for Enterprise Linux 7 - x86_64 94 ol7_UEKR5/x86_64 Latest Unbreakable Enterprise Kernel Release 5 for Oracle Linux 7Server (x86_64) 280 ol7_addons/x86_64 Oracle Linux 7Server Add ons (x86_64) 467 ol7_developer/x86_64 Oracle Linux 7Server Development Packages (x86_64) 1,503 ol7_developer_EPEL/x86_64 Oracle Linux 7Server Development Packages (x86_64) 33,021 ol7_latest/x86_64 Oracle Linux 7Server Latest (x86_64) 19,428 ol7_optional_latest/x86_64 Oracle Linux 7Server Optional Latest (x86_64) 14,174 ol7_software_collections/x86_64 Software Collection Library release 3.0 packages for Oracle Linux 7 (x86_64)

mrhorvath commented 4 years ago

Yeah, I had this same problem on a fresh RHEL 7.8 this afternoon. The workaround of changing the base paths resulted in

yum install -y docker-ce docker-ce-cli containerd.io

Loaded plugins: enabled_repos_upload, package_upload, product-id, search-disabled-repos, subscription-manager No package docker-ce available. No package docker-ce-cli available. No package containerd.io available. Error: Nothing to do

for me as well.

jamesoc commented 4 years ago

We are using releasever 7.8. Is there an expectation that this will be fixed in the repo 'in the near term' so that these workarounds are not required?

Regards.

ghost commented 4 years ago
sudo yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-engine
sudo yum install -y yum-utils
sudo yum-config-manager \
     --add-repo \
     https://download.docker.com/linux/centos/docker-ce.repo
sudo yum-config-manager --setopt="docker-ce-stable.baseurl=https://download.docker.com/linux/centos/7/x86_64/stable" --save
sudo yum install -y http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.107-3.el7.noarch.rpm
sudo yum install -y https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm
sudo yum install -y docker-ce docker-ce-cli containerd.io
sudo systemctl enable docker
sudo systemctl start docker
sudo docker run -it --name hello-world --rm hello-world
msbecker commented 4 years ago

@mettacrawler I can confirm your latest workaround did the trick. I was able to install docker using those steps.

ghost commented 4 years ago

We are using releasever 7.8. Is there an expectation that this will be fixed in the repo 'in the near term' so that these workarounds are not required?

Regards.

Podman give you rootless (not using the root account to run) containers on RHEL 7 right now. Think about the security improvements. https://www.redhat.com/en/blog/rhel-78-and-final-update-container-tools Podman works with Dockerfiles and Docker repositories, so much of the software there is available and more will be over time. There's podman-compose intended to be much like docker-compose and it becomes even more like it over time https://github.com/containers/podman-compose Red Hat will actually support you on Podman (they are no longer supporting Docker). People are using Podman to do things right now. Better study it early so you're not left behind.

M0rdecay commented 4 years ago

Any news on this? We are deploying docker via ansible, using workarounds requires changing roles, which we would like to avoid.

tonton1728 commented 4 years ago

On our side, we are building some docker image with docker inside (inception I know) and we would like not to have to edit repo file in our dockerfile. As far as I know, creating an alias for 7Server to 7 should do the trick, when can we hope to have a fix ?

ghost commented 4 years ago

@tonton1728 When I first encountered this issue I was trying to rebuild an AWS AMI via Packer and it crashed trying to install docker-ce. The Ansible that Packer was invoking never tried to install a containerd.io RPM and it worked anyway. If all you are doing is installing a docker-ce RPM then you don't need to download a CentOS container-selinux RPM to support a containerd.io. In that case just changing the docker-ce-stable.baseurl from using $releasever to using a hard-coded 7 will work.

If you need to install a CentOS containerd.io RPM you will also need to install a CentOS container-selinux RPM and doing that is a bit messy.

jamesoc commented 4 years ago

We are using releasever 7.8. Is there an expectation that this will be fixed in the repo 'in the near term' so that these workarounds are not required? Regards.

Podman give you rootless (not using the root account to run) containers on RHEL 7 right now. Think about the security improvements. https://www.redhat.com/en/blog/rhel-78-and-final-update-container-tools Podman works with Dockerfiles and Docker repositories, so much of the software there is available and more will be over time. There's podman-compose intended to be much like docker-compose and it becomes even more like it over time https://github.com/containers/podman-compose Red Hat will actually support you on Podman (they are no longer supporting Docker). People are using Podman to do things right now. Better study it early so you're not left behind.

Thank you @mettacrawler for the response. I will investigate Podman when I have a little breathing room. Right now, I am not able to execute my ansible script on my hosts that are built with releasever 7.8 and need to get them working in the short term.

My Ansible below breaks on this last step (Install Docker CE) indicating: https://download.docker.com/linux/centos/7.8/x86_64/stable/repodata/repomd.xml: [Errno 14] Error 404 - Not Found

Just to be clear, this is the replacement for commands?

sudo yum install -y yum-utils sudo yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo sudo yum-config-manager --setopt="docker-ce-stable.baseurl=https://download.docker.com/linux/centos/7/x86_64/stable" --save sudo yum install -y http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.107-3.el7.noarch.rpm sudo yum install -y https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm sudo yum install -y docker-ce docker-ce-cli containerd.io

Thank you, -Jim O.

ghost commented 4 years ago

@jamesoc Please try: Replace

shell: yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

With

shell: |
    yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
    yum-config-manager --setopt="docker-ce-stable.baseurl=https://download.docker.com/linux/centos/7/x86_64/stable" --save
jamesoc commented 4 years ago

@jamesoc Please try: Replace

shell: yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

With

shell: |
    yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
    yum-config-manager --setopt="docker-ce-stable.baseurl=https://download.docker.com/linux/centos/7/x86_64/stable" --save

Thank you very much @mettacrawler; I will give that a try. cheers!

ghost commented 4 years ago

This issue was first mentioned on the Docker Community Formus on September 24, 2020. https://forums.docker.com/t/docker-ce-stable-x86-64-repo-not-available-https-error-404-not-found-https-download-docker-com-linux-centos-7server-x86-64-stable-repodata-repomd-xml

bminahan-kc commented 4 years ago

+1 this is affecting me as well. I just manually changed the docker.repo file to point from 7Server to 7 as a workaround.

Raptorzil commented 4 years ago

same for me.

erlarson85 commented 4 years ago

Same here.

archit-goel commented 4 years ago

Any updates here on this please. it's been open for around 2 weeks now.

ali919191 commented 4 years ago

docker run -it --name hello-world --rm hello-world

Hey there, I still see below error after following your steps

Complete! [root@c yum.repos.d]# systemctl enable docker Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service. [root@c yum.repos.d]# systemctl start docker [root@c yum.repos.d]# docker run -it --name hello-world --rm hello-world bash: docker: command not found [root@c yum.repos.d]#

ali919191 commented 4 years ago

docker run -it --name hello-world --rm hello-world

Hey there, I still see below error after following your steps

Complete! [root@c yum.repos.d]# systemctl enable docker Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service. [root@c yum.repos.d]# systemctl start docker [root@c yum.repos.d]# docker run -it --name hello-world --rm hello-world bash: docker: command not found [root@c yum.repos.d]#

[root@c yum.repos.d]# yum install -y http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.107-3.el7.noarch.rpm
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

container-selinux-2.107-3.el7.noarch.rpm                                                                                                                                        |  39 kB  00:00:00
Examining /var/tmp/yum-root-44jDCT/container-selinux-2.107-3.el7.noarch.rpm: 2:container-selinux-2.107-3.el7.noarch
Marking /var/tmp/yum-root-44jDCT/container-selinux-2.107-3.el7.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package container-selinux.noarch 2:2.107-3.el7 will be installed
--> Finished Dependency Resolution
docker-ce-stable                                                                                                                                                                | 3.5 kB  00:00:00
rhel-7Server-x86_64-extras/7Server/x86_64                                                                                                                                       | 3.6 kB  00:00:00
rhel-7Server-x86_64-jb-ews-2/7Server/x86_64                                                                                                                                     | 3.6 kB  00:00:00
rhel-7Server-x86_64-kaisercustom/7Server/x86_64                                                                                                                                 | 2.9 kB  00:00:00
rhel-7Server-x86_64-optional/7Server/x86_64                                                                                                                                     | 3.6 kB  00:00:00
rhel-7Server-x86_64-rhscl/7Server/x86_64                                                                                                                                        | 3.6 kB  00:00:00
rhel-7Server-x86_64-supplementary/7Server/x86_64                                                                                                                                | 3.6 kB  00:00:00
rhel-7Server-x86_64-update/7Server/x86_64                                                                                                                                       | 3.6 kB  00:00:00

Dependencies Resolved

=======================================================================================================================================================================================================
 Package                                       Arch                               Version                                      Repository                                                         Size
=======================================================================================================================================================================================================
Installing:
 container-selinux                             noarch                             2:2.107-3.el7                                /container-selinux-2.107-3.el7.noarch                              40 k

Transaction Summary
=======================================================================================================================================================================================================
Install  1 Package

Total size: 40 k
Installed size: 40 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 2:container-selinux-2.107-3.el7.noarch                                                                                                                                              1/1
setsebool:  SELinux is disabled.
  Verifying  : 2:container-selinux-2.107-3.el7.noarch                                                                                                                                              1/1

Installed:
  container-selinux.noarch 2:2.107-3.el7

Complete!
[root@c yum.repos.d]# yum install -y https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

containerd.io-1.2.6-3.3.el7.x86_64.rpm                                                                                                                                          |  26 MB  00:00:00
Examining /var/tmp/yum-root-44jDCT/containerd.io-1.2.6-3.3.el7.x86_64.rpm: containerd.io-1.2.6-3.3.el7.x86_64
Marking /var/tmp/yum-root-44jDCT/containerd.io-1.2.6-3.3.el7.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package containerd.io.x86_64 0:1.2.6-3.3.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================================================================================================================================
 Package                                     Arch                                 Version                                      Repository                                                         Size
=======================================================================================================================================================================================================
Installing:
 containerd.io                               x86_64                               1.2.6-3.3.el7                                /containerd.io-1.2.6-3.3.el7.x86_64                                96 M

Transaction Summary
=======================================================================================================================================================================================================
Install  1 Package

Total size: 96 M
Installed size: 96 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : containerd.io-1.2.6-3.3.el7.x86_64                                                                                                                                                  1/1
  Verifying  : containerd.io-1.2.6-3.3.el7.x86_64                                                                                                                                                  1/1

Installed:
  containerd.io.x86_64 0:1.2.6-3.3.el7

Complete!
[root@c yum.repos.d]# yum install -y docker-ce docker-ce-cli containerd.io
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

Package 1:docker-ce-cli-19.03.13-3.el7.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package containerd.io.x86_64 0:1.2.6-3.3.el7 will be updated
---> Package containerd.io.x86_64 0:1.3.7-3.1.el7 will be an update
---> Package docker-ce.x86_64 3:19.03.13-3.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================================================================================================================================
 Package                                         Arch                                     Version                                             Repository                                          Size
=======================================================================================================================================================================================================
Installing:
 docker-ce                                       x86_64                                   3:19.03.13-3.el7                                    docker-ce-stable                                    24 M
Updating:
 containerd.io                                   x86_64                                   1.3.7-3.1.el7                                       docker-ce-stable                                    29 M

Transaction Summary
=======================================================================================================================================================================================================
Install  1 Package
Upgrade  1 Package

Total download size: 53 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/2): docker-ce-19.03.13-3.el7.x86_64.rpm                                                                                                                                      |  24 MB  00:00:00
(2/2): containerd.io-1.3.7-3.1.el7.x86_64.rpm                                                                                                                                   |  29 MB  00:00:01
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                   37 MB/s |  53 MB  00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : containerd.io-1.3.7-3.1.el7.x86_64                                                                                                                                                  1/3
  Installing : 3:docker-ce-19.03.13-3.el7.x86_64                                                                                                                                                   2/3
  Cleanup    : containerd.io-1.2.6-3.3.el7.x86_64                                                                                                                                                  3/3
  Verifying  : containerd.io-1.3.7-3.1.el7.x86_64                                                                                                                                                  1/3
  Verifying  : 3:docker-ce-19.03.13-3.el7.x86_64                                                                                                                                                   2/3
  Verifying  : containerd.io-1.2.6-3.3.el7.x86_64                                                                                                                                                  3/3

Installed:
  docker-ce.x86_64 3:19.03.13-3.el7

Updated:
  containerd.io.x86_64 0:1.3.7-3.1.el7

Complete!
[root@c yum.repos.d]# systemctl enable docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
[root@c yum.repos.d]# systemctl start docker
[root@c yum.repos.d]# docker run -it --name hello-world --rm hello-world
bash: docker: command not found
[root@c yum.repos.d]# docker version
bash: docker: command not found
[root@c yum.repos.d]# docker info
bash: docker: command not found
ali919191 commented 4 years ago

ANY UPDATE ON THIS????

ali919191 commented 4 years ago

Okay a new issue arose this morning:

[root@c lib]# yum install -y docker-ce
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Resolving Dependencies
--> Running transaction check
---> Package docker-ce.x86_64 3:19.03.13-3.el7 will be installed
--> Processing Dependency: container-selinux >= 2:2.74 for package: 3:docker-ce-19.03.13-3.el7.x86_64
--> Processing Dependency: containerd.io >= 1.2.2-3 for package: 3:docker-ce-19.03.13-3.el7.x86_64
--> Running transaction check
---> Package container-selinux.noarch 2:2.119.2-1.911c772.el7_8 will be installed
---> Package containerd.io.x86_64 0:1.3.7-3.1.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=================================================================================================================================================================================
 Package                                  Arch                          Version                                          Repository                                         Size
=================================================================================================================================================================================
Installing:
 docker-ce                                x86_64                        3:19.03.13-3.el7                                 docker-ce-stable                                   24 M
Installing for dependencies:
 container-selinux                        noarch                        2:2.119.2-1.911c772.el7_8                        rhel-7Server-x86_64-extras                         40 k
 containerd.io                            x86_64                        1.3.7-3.1.el7                                    docker-ce-stable                                   29 M
Transaction Summary
=================================================================================================================================================================================
Install  1 Package (+2 Dependent packages)
Total download size: 53 M
Installed size: 214 M
Downloading packages:
(1/3): container-selinux-2.119.2-1.911c772.el7_8.noarch.rpm                                                                                               |  40 kB  00:00:00
(2/3): docker-ce-19.03.13-3.el7.x86_64.rpm                                                                                                                |  24 MB  00:00:01
(3/3): containerd.io-1.3.7-3.1.el7.x86_64.rpm                                                                                                             |  29 MB  00:00:01
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                             30 MB/s |  53 MB  00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 2:container-selinux-2.119.2-1.911c772.el7_8.noarch                                                                                                            1/3
setsebool:  SELinux is disabled.
  Installing : containerd.io-1.3.7-3.1.el7.x86_64                                                                                                                            2/3
  Installing : 3:docker-ce-19.03.13-3.el7.x86_64                                                                                                                             3/3
  Verifying  : containerd.io-1.3.7-3.1.el7.x86_64                                                                                                                            1/3
  Verifying  : 2:container-selinux-2.119.2-1.911c772.el7_8.noarch                                                                                                            2/3
  Verifying  : 3:docker-ce-19.03.13-3.el7.x86_64                                                                                                                             3/3
Installed:
  docker-ce.x86_64 3:19.03.13-3.el7
Dependency Installed:
  container-selinux.noarch 2:2.119.2-1.911c772.el7_8                                             containerd.io.x86_64 0:1.3.7-3.1.el7
Complete!

[root@c lib]# yum install -y docker-ce docker-ce-cli containerd.io
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Package 3:docker-ce-19.03.13-3.el7.x86_64 already installed and latest version
Package 1:docker-ce-cli-19.03.13-3.el7.x86_64 already installed and latest version
Package containerd.io-1.3.7-3.1.el7.x86_64 already installed and latest version
Nothing to do

[root@c lib]# docker
bash: docker: command not found

[root@c lib]# systemctl start docker

[root@c lib]# systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: active (running) since Thu 2020-10-08 07:11:11 PDT; 2s ago
     Docs: https://docs.docker.com
 Main PID: 7337 (dockerd)
    Tasks: 15
   Memory: 42.1M
   CGroup: /system.slice/docker.service
           └─7337 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
Oct 08 07:11:10 c dockerd[7337]: time="2020-10-08T07:11:10.821368669-07:00" level=info msg="scheme \"unix\" not registered, fallback to default scheme" module=grpc
Oct 08 07:11:10 c dockerd[7337]: time="2020-10-08T07:11:10.821396988-07:00" level=info msg="ccResolverWrapper: sending update to cc: {[{unix:///run/co...odule=grpc
Oct 08 07:11:10 c dockerd[7337]: time="2020-10-08T07:11:10.821416048-07:00" level=info msg="ClientConn switching balancer to \"pick_first\"" module=grpc
Oct 08 07:11:10 c dockerd[7337]: time="2020-10-08T07:11:10.836392370-07:00" level=info msg="Loading containers: start."
Oct 08 07:11:10 c dockerd[7337]: time="2020-10-08T07:11:10.927306850-07:00" level=info msg="Default bridge (docker0) is assigned with an IP address 17...P address"
Oct 08 07:11:10 c dockerd[7337]: time="2020-10-08T07:11:10.975844431-07:00" level=info msg="Loading containers: done."
Oct 08 07:11:11 c dockerd[7337]: time="2020-10-08T07:11:11.001912719-07:00" level=info msg="Docker daemon" commit=4484c46d9d graphdriver(s)=overlay2 v...n=19.03.13
Oct 08 07:11:11 c dockerd[7337]: time="2020-10-08T07:11:11.002041797-07:00" level=info msg="Daemon has completed initialization"
Oct 08 07:11:11 c systemd[1]: Started Docker Application Container Engine.
Oct 08 07:11:11 c dockerd[7337]: time="2020-10-08T07:11:11.035170425-07:00" level=info msg="API listen on /var/run/docker.sock"
Hint: Some lines were ellipsized, use -l to show in full.

[root@c lib]# docker
bash: docker: command not found

[root@c lib]#

[root@c yum.repos.d]# ls -ltr
total 8
-rw-r--r-- 1 root root    0 Aug 26 15:40 unreg_sat_marker_do_not_delete_20200214
drw-r--r-- 2 root root   29 Oct  8 03:30 backup
-rw-r--r-- 1 root root 1949 Oct  8 03:30 bigfix_yum.repo
-rw-r--r-- 1 root root 1920 Oct  8 06:41 docker-ce.repo
[root@c yum.repos.d]# cat docker-ce.repo
[docker-ce-stable]
name=Docker CE Stable - $basearch
baseurl=https://download.docker.com/linux/centos/7/x86_64/stable
enabled=1
gpgcheck=1
gpgkey=https://download.docker.com/linux/centos/gpg
keepcache = 0

[docker-ce-stable-debuginfo]
name=Docker CE Stable - Debuginfo $basearch
baseurl=https://download.docker.com/linux/centos/$releasever/debug-$basearch/stable
enabled=0
gpgcheck=1
gpgkey=https://download.docker.com/linux/centos/gpg

[docker-ce-stable-source]
name=Docker CE Stable - Sources
baseurl=https://download.docker.com/linux/centos/$releasever/source/stable
enabled=0
gpgcheck=1
gpgkey=https://download.docker.com/linux/centos/gpg

[docker-ce-test]
name=Docker CE Test - $basearch
baseurl=https://download.docker.com/linux/centos/$releasever/$basearch/test
enabled=0
gpgcheck=1
gpgkey=https://download.docker.com/linux/centos/gpg

[docker-ce-test-debuginfo]
name=Docker CE Test - Debuginfo $basearch
baseurl=https://download.docker.com/linux/centos/$releasever/debug-$basearch/test
enabled=0
gpgcheck=1
gpgkey=https://download.docker.com/linux/centos/gpg

[docker-ce-test-source]
name=Docker CE Test - Sources
baseurl=https://download.docker.com/linux/centos/$releasever/source/test
enabled=0
gpgcheck=1
gpgkey=https://download.docker.com/linux/centos/gpg

[docker-ce-nightly]
name=Docker CE Nightly - $basearch
baseurl=https://download.docker.com/linux/centos/$releasever/$basearch/nightly
enabled=0
gpgcheck=1
gpgkey=https://download.docker.com/linux/centos/gpg

[docker-ce-nightly-debuginfo]
name=Docker CE Nightly - Debuginfo $basearch
baseurl=https://download.docker.com/linux/centos/$releasever/debug-$basearch/nightly
enabled=0
gpgcheck=1
gpgkey=https://download.docker.com/linux/centos/gpg

[docker-ce-nightly-source]
name=Docker CE Nightly - Sources
baseurl=https://download.docker.com/linux/centos/$releasever/source/nightly
enabled=0
gpgcheck=1
gpgkey=https://download.docker.com/linux/centos/gpg
[root@c yum.repos.d]#
ali919191 commented 4 years ago
[cis@c ~]$ systemctl status docker.service
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2020-10-08 08:37:46 PDT; 18min ago
     Docs: https://docs.docker.com
 Main PID: 19071 (dockerd)
   CGroup: /system.slice/docker.service
           └─19071 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
[cis@c ~]$ cat /usr/lib/systemd/system/docker.service
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
BindsTo=containerd.service
After=network-online.target firewalld.service containerd.service
Wants=network-online.target
Requires=docker.socket

[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
ExecReload=/bin/kill -s HUP $MAINPID
TimeoutSec=0
RestartSec=2
Restart=always

# Note that StartLimit* options were moved from "Service" to "Unit" in systemd 229.
# Both the old, and new location are accepted by systemd 229 and up, so using the old location
# to make them work for either version of systemd.
StartLimitBurst=3

# Note that StartLimitInterval was renamed to StartLimitIntervalSec in systemd 230.
# Both the old, and new name are accepted by systemd 230 and up, so using the old name to make
# this option work for either version of systemd.
StartLimitInterval=60s

# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity

# Comment TasksMax if your systemd version does not support it.
# Only systemd 226 and above support this option.
TasksMax=infinity

# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes

# kill only the docker process, not all processes in the cgroup
KillMode=process

[Install]
WantedBy=multi-user.target
[cis@c ~]$
jaalle commented 4 years ago

Hello,

Any chance this is going to be resolved soon? RHEL isn't listed as a "supported" OS: https://docs.docker.com/engine/install/#server

and we're following the instructions here: https://docs.docker.com/engine/install/centos/

to install docker on CentOS (and RHEL, where it should also and does work). Do we need to gate the docker deploy to enforce a "no docker-ce on RHEL" condition, redirect to: https://download.docker.com/linux/rhel/docker-ce.repo

when deploying on RHEL (will this file be kept up-to-date?), or will the project create a symbolic link from "7Server" to "7" for people deploying from the CentOS repository on RHEL?

Just looking for the project's permanent resolution so that we can update our deployment automation.

ali919191 commented 3 years ago

This problem resolved for me after copying the entire contents of /etc/yum.repos.d of the working server to the new server and running yum install -y docker-ce docker-ce-cli containerd.io

gflcampos commented 3 years ago

I came up with a slightly more elegant version of @mettacrawler's workaround for RHEL 7.

There is no need to specify the versions for container-selinux or containerd.io. You can just add http://mirror.centos.org/centos/7/extras/x86_64/ as a repo and then do a regular install of container-selinux. After this, installing docker-ce will automatically install container.io as a dependency:

sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum-config-manager --setopt="docker-ce-stable.baseurl=https://download.docker.com/linux/centos/7/x86_64/stable" --save

sudo yum-config-manager --add-repo=http://mirror.centos.org/centos/7/extras/x86_64/
sudo rpm --import https://www.centos.org/keys/RPM-GPG-KEY-CentOS-7
sudo yum install container-selinux docker-ce
viresh-contino commented 3 years ago

Just experienced this issue! What a nightmare... I basically added the ansible shell commands as per above to overcome this issue.

bitva77 commented 3 years ago

The fact that this isn't fixed yet makes me feel like Docker did this on purpose in retaliation to RH creating podman.

and now innocent end users are being punished for it.

stay classy every body.

ghost commented 3 years ago

@gflcampos adding the CentOS repository may cause other RPMs to come from CentOS.

A usable version of the container-selinux RPM is available from certain RHEL and Oracle repositories. If they are available to you, you do not need to use the CentOS container-selinux RPM. You still have to use the CentOS docker-ce RPM from Docker.

First

sudo yum install -y yum-utils

For AWS see https://access.redhat.com/articles/4599971

sudo yum-config-manager --enable rhel-7-server-rhui-extras-rpms

For Azure:

sudo yum-config-manager --enable rhui-rhel-7-server-rhui-extras-rpms

For Oracle Linux 7

sudo yum-config-manager --enable ol7_addons

Then on any of them (see https://docs.docker.com/engine/install/centos/ for most of this.)

sudo yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-engine
sudo yum-config-manager \
     --add-repo \
     https://download.docker.com/linux/centos/docker-ce.repo
sudo yum-config-manager --setopt="docker-ce-stable.baseurl=https://download.docker.com/linux/centos/7/x86_64/stable" --save
sudo yum install -y docker-ce
sudo systemctl enable docker
sudo systemctl start docker
sudo docker run -it --name hello-world --rm hello-world
bviktor commented 3 years ago

FYI, on RHEL it's rhel-7-server-extras-rpms.

rabievdm commented 3 years ago

It looks like the symlinks have been restored, however the webserver is now trying to serve a index.html when using the symlinked version of the url, so it doesn't look like it allows directory browsing on the symlinked URL's eg: https://download.docker.com/linux/centos/7Server/x86_64/stable/repodata/ However when you change the URL to: https://download.docker.com/linux/centos/7/x86_64/stable/repodata/

Using the first link you now get: 404 Not Found

Code: NoSuchKey
Message: The specified key does not exist.
Key: linux/centos/7Server/x86_64/stable/repodata/index.html
RequestId: F75B851869AEDF71
HostId: u+9L/FFsIFyJA2g4eZooSHZhbuM5QZDsO6hf5I+XDfEm0Ixr2mc4gK9XKZ+TCi3jIQeAUVXZZWc=
bviktor commented 3 years ago

yum doesn't need to "browse" the dirs, it uses predefined files.

rabievdm commented 3 years ago

Fair, but its still broken when I trying and just do a yum list, so the perms must still be broken.

[root@docdev01 ~]# yum list https://download.docker.com/linux/centos/7Server/x86_64/stable/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found Trying other mirror.

You can recreate the error without yum, just try with wget: wget https://download.docker.com/linux/centos/7Server/x86_64/stable/repodata/repomd.xml --2020-11-23 15:27:19-- https://download.docker.com/linux/centos/7Server/x86_64/stable/repodata/repomd.xml Resolving download.docker.com (download.docker.com)... 143.204.64.100, 143.204.64.9, 143.204.64.159, ... Connecting to download.docker.com (download.docker.com)|143.204.64.100|:443... connected. HTTP request sent, awaiting response... 404 Not Found 2020-11-23 15:27:21 ERROR 404: Not Found.

mrjk commented 3 years ago

Honestly I feel it's unacceptable that this 4 months old bug is still open. How long does it takes to do a symlink or a 301 http redirect on a web server? I mean this is admin level 0, so what is the technical challenge that need to be accomplished to solve this issue? None.

Well, I feel this is the time to migrate away from Docker because all what we did is now broken (thanks by the way) and require us to workaround in the worst way. What is the point of automating everything if we can't reuse what has been done, isn't the Docker promise ? I don't feel breaking things is the correct way to do for the docker user base, but well, I feel there is a lots of politics behind this choice of not fixing this issue, and I don't feel comfortable with this anymore. Also I don't pay for any service/support so I shouldn't complain, but this bug is a very bad joke.

Pictor13 commented 3 years ago

I fixed the repo URl via:

sed -i 's/$releasever/7/g' /etc/yum.repos.d/docker-ce.repo

according to this forum thread suggestions.

Might help other fix temporary and get work done.

epijonk commented 3 years ago

lol.. still not fixed. I just ran into this error.