1

I'm on an AWS EC2 instance and I'm trying to install docker on the instance.

i first run sudo yum update -y and then sudo yum install -y docker

but then i tried to start the docker service using sudo service docker start i got the error below:

Redirecting to /bin/systemctl start docker.service

enter image description here

i ran dockerd cammand and i got this which seems like everything is fine: enter image description here

i have no clue whatsoever what could be the cause of this! i tried many possible solutions such as these Docker service start failed but it was to no avail!

Ebdulmomen1
  • 606
  • 1
  • 10
  • 21

1 Answers1

2

It seems you had installed docker-daemon mode, not docker service.

Remove old versions

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 install docker-ce docker-ce-cli containerd.io

sudo systemctl start docker

Docker has a great documentation, please always refer them. For centOS

Edit : If you have rhel-7 you may get

error failure: repodata/repomd.xml from docker-ce-stable: [Errno 256] No more mirrors to try.

sudo yum remove docker docker-common docker-selinux docker-engine-selinux docker-engine docker-ce
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install docker-ce

If the error persists, enable the repository by running the following command ~~~ Redhat discussion

yum-config-manager --enable REPOSITORY yum install docker

Sachith Muhandiram
  • 2,819
  • 10
  • 45
  • 94