You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

基于RHEL7.2 AMI的AWS EC2实例无法安装Docker求助

Hey there, let's get that Docker installation sorted on your RHEL 7.2 EC2 instance. The "No package docker available" error pops up because the default YUM repositories for RHEL 7.2 don't include Docker out of the box. Here are two reliable ways to fix this:

Option 1: Use RHEL's Official Extras Repository (for older, supported Docker version)

This uses the Docker package maintained by Red Hat, which integrates seamlessly with your RHEL system.

  • First, install yum-utils if you don't have it (it helps manage repositories easily):
    yum install yum-utils -y
    
  • Enable the RHEL 7 Server Extras repository, where the Docker package is hosted:
    yum-config-manager --enable rhel-7-server-extras-rpms
    
  • Now install Docker (note: on RHEL 7.2, the package name might be docker-engine instead of just docker—if docker still isn't found, swap it for docker-engine):
    yum install docker-engine -y
    

Option 2: Install Docker CE (Official, more recent compatible version)

If you want a newer Docker release that still works with RHEL 7.2, go with Docker Community Edition (CE). Since RHEL is binary-compatible with CentOS, we can use the CentOS Docker repository safely:

  • Install required dependencies first to avoid setup issues:
    yum install yum-utils device-mapper-persistent-data lvm2 -y
    
  • Add Docker's official CentOS repository:
    yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
    
  • Install a version of Docker CE that supports RHEL 7.2 (newer versions won't work on this old OS—we'll use a tested 18.09.x release):
    yum install docker-ce-18.09.9 docker-ce-cli-18.09.9 containerd.io -y
    

Final Steps After Installation

No matter which option you choose, finish with these commands to get Docker up and running:

  • Start the Docker service:
    systemctl start docker
    
  • Set Docker to start automatically on system boot:
    systemctl enable docker
    
  • Verify the installation worked:
    docker --version
    

If you run into any dependency conflicts, try updating your system first with yum update -y—that often resolves missing package issues on older RHEL releases.

内容的提问来源于stack exchange,提问作者Rocky

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 08:02:39