Docker CE on RHEL - Requires: container-selinux >= 2.9

前端 未结 18 1181
余生分开走
余生分开走 2020-12-07 13:19

I am trying to install Docker CE on RHEL using this link. This is my RHEL version:

Red Hat Enterprise Linux Server release 7.3 (Mai         


        
18条回答
  •  無奈伤痛
    2020-12-07 13:48

    Update June 2019

    What a dogs dinner. Unfortunately, the other answers didn't work for me.

    For the most part, the official docker instructions for installing using a repository DID work.

    sudo yum install -y yum-utils \
      device-mapper-persistent-data \
      lvm2
    

    Followed by:

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

    However, I had to modify the next command as follows (adding --nobest):

    sudo yum install docker-ce --nobest
    

    Finally, check the docker client:

    docker --version
    Docker version 18.09.7, build 2d0083d
    

    Note also, the above works for standard RHEL AMI on AWS, but not for the Amazon Linux AMI type. May also find referencing this github issue insightful.

    Added bonus, I found the following additional commands helpful:

    Start the docker daemon:

    sudo systemctl start docker.service
    

    Give the current user (in my case ec2-user - check with whoami) rights to the docker group. This avoids running everything with sudo.

    sudo usermod -aG docker $USER
    

    Now, logoff and login again as same user as before (in my case ec2-user).

    At this point, everything should be working. Check the docker daemon:

    docker image ls
    REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
    

提交回复
热议问题