RHEL 7 Linux 서버에 Docker를 설치할 때 발생하는 문제

RHEL 7 Linux 서버에 Docker를 설치할 때 발생하는 문제

나는 최근에 이 문제에 점점 더 많이 직면하게 되었고, 완전히 막혀서 도움이 필요하게 되었습니다.

방금 RHEL EC2 Linux 서버에 액세스하여 Docker를 설치하려고 했습니다. 최근에는 이 과정이 매우 고통스럽습니다. 온라인에 언급된 프로세스를 따르려고 할 때 많은 404 HTTP 찾을 수 없음 오류가 발생함

~에 따르면https://docs.aws.amazon.com/AmazonECS/latest/developerguide/docker-basics.html, 다음 두 명령 중 하나를 간단히 실행할 수 있습니다.

  • sudo amazon-linux-extras 설치 도커
  • sudo yum 도커 설치

그러나 아래 출력에 표시된 것처럼 이러한 명령 중 어느 것도 작동하지 않습니다.

[root@d8de679d27f2454 myuser]# sudo amazon-linux-extras install docker
sudo: amazon-linux-extras: command not found
[root@d8de679d27f2454 myuser]# yum install docker
Loaded plugins: amazon-id, search-disabled-repos
No package docker available.
Error: Nothing to do
[root@d8de679d27f2454 myuser]#

내가 시도한 작업 목록은 다음과 같습니다.

첫 시도(에 대한:https://stackoverflow.com/questions/53918841/how-to-install-docker-on-amazon-linux2)

두 번째 제안 답변은 다음 명령을 실행할 수 있다는 것입니다.

sudo yum update -y
sudo yum -y install docker

그러나 아래 출력에 표시된 것처럼 이 방법도 작동하지 않습니다.

[root@d8de679d27f2454 myuser]# yum update -y
Loaded plugins: amazon-id, search-disabled-repos
No packages marked for update
[root@d8de679d27f2454 myuser]# yum -y install docker
Loaded plugins: amazon-id, search-disabled-repos
No package docker available.
Error: Nothing to do
[root@d8de679d27f2454 myuser]# 

두 번째 시도: 설치가 완료되었습니다.get.docker.com

실행 중에는 curl https://get.docker.com | bash작동하지 않습니다.

여기에 이미지 설명을 입력하세요.

세 번째 시도:https://computingforgeeks.com/install-docker-ce-on-rhel-7-linux/

이 문서의 일부에서는 다음 두 명령을 실행하도록 권장합니다.

sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum install -y yum-utils device-mapper-persistent-data lvm2

그러나 이것도 작동하지 않습니다.

# yum install -y yum-utils device-mapper-persistent-data lvm2
Loaded plugins: amazon-id, product-id, search-disabled-repos, subscription-manager

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

https://download.docker.com/linux/rhel/7/x86_64/stable/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below knowledge base article 

https://access.redhat.com/articles/1320623

If above article doesn't help to resolve this issue please open a ticket with Red Hat Support.



 One of the configured repositories failed (Docker CE Stable - x86_64),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Run the command with the repository temporarily disabled
            yum --disablerepo=docker-ce-stable ...

     4. Disable the repository permanently, so yum won't use it by default. Yum
        will then just ignore the repository until you permanently enable it
        again or use --enablerepo for temporary usage:

            yum-config-manager --disable docker-ce-stable
        or
            subscription-manager repos --disable=docker-ce-stable

     5. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=docker-ce-stable.skip_if_unavailable=true

failure: repodata/repomd.xml from docker-ce-stable: [Errno 256] No more mirrors to try.
https://download.docker.com/linux/rhel/7/x86_64/stable/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found

cat /etc/os-release이것은 내 명령의 결과입니다.

NAME="Red Hat Enterprise Linux Server"
VERSION="7.9 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="7.9"
PRETTY_NAME="Red Hat Enterprise Linux Server 7.9 (Maipo)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.9:GA:server"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

어떤 도움이라도 대단히 감사하겠습니다. 현재 시점에서는 docker 설치가 거의 불가능해 보입니다.

답변1

/etc/yum.repos.d/의 repo 파일을 다음 파일로 바꾸십시오.

https://download.docker.com/linux/centos/docker-ce.repo

다운로드한 버전은 s390x 시스템을 실행하는 데에만 적합합니다. Docker는 사람들을 항상 혼란스럽게 만드는 yum 저장소를 구축하는 방법에 대해 약간 어리석습니다.

증거: 카탈로그를 참조하십시오rhel/7 디렉토리에 비해centos/7 디렉토리. rhel 디렉터리에는 s390x와 소스 코드만 포함되어 있는 반면 CentOS에는 패키지와 저장소 메타데이터가 포함된 x86_64 디렉터리가 있습니다.

답변2

sudo: amazon-linux-extras: 명령을 찾을 수 없습니다

Mean amazon-linux-extras은 아직 설치되지 않았습니다. 설치해야 합니다.

sudo yum install -y amazon-linux-extras

Docker는 Extras에서 사용할 수 있습니다.

추가 기능에만 있는 Docker

Docker 패키지는 extras를 통해서만 사용할 수 있으며 기본적으로 활성화되어 있습니다. Docker의 새 버전이 출시되면 최신 안정 패키지에 대해서만 지원이 제공됩니다.

도커를 설치하려면:

sudo amazon-linux-extras install docker
sudo service docker start
sudo usermod -a -G docker ec2-user

Amazon: Docker 설치

답변3

RHEL 7 Linux 서버에 Docker를 설치할 때 발생하는 문제

참고로 현재 다음과 같은 가이드가 있습니다.

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux_atomic_host/7/html-single/getting_started_with_containers/index#getting_docker_in_rhel_7

답변4

/etc/yum.repos.d/docker.repo소유물을 만들다

[docker]
name=docker
gpgcheck=1
enabled=1
baseurl=https://download.docker.com/linux/centos/7/x86_64/stable

유효한 RHEL docker 저장소는 없는 것 같지만 centos docker 저장소를 사용할 수 있습니다.

nvidia docker를 지원하는 추가 리포지토리(아래 참조)에 대해 자세히 설명하지 않았지만 nvidia docker 웹 사이트에 게시된 지침은 유효합니다.

그런 다음 RHEL 7.9 x86-64에서는 다음이 나에게 효과적이었습니다.

yum install
 containerd.io-1.4.3-3.1.el7.x86_64.rpm
 docker-ce-20.10.5-3.el7.x86_64.rpm
 docker-ce-cli-20.10.5-3.el7.x86_64.rpm
 docker-ce-rootless-extras-20.10.5-3.el7.x86_64.rpm
 libnvidia-container1-1.3.3-1.x86_64.rpm
 libnvidia-container-tools-1.3.3-1.x86_64.rpm
 nvidia-container-runtime-3.4.2-1.x86_64.rpm
 nvidia-container-toolkit-1.4.2-2.x86_64.rpm
 nvidia-docker2-2.5.0-1.noarch.rpm

systemctl --now enable docker
systemctl restart docker
systemctl status docker
docker -v
  Docker version 20.10.5, build 55c4c88

사용 가능한 지정된 GPG 키는 다음과 같습니다.

gpgkey-docker-ce-centos
gpgkey-docker-ce-rhel
gpgkey-libnvidia-container
gpgkey-nvidia-container-runtime
gpgkey-nvidia-docker

Docker와 Nvidia는 RHEL 7.9에서 작동할 수 있습니다.

관련 정보