Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't install docker on amazon linux instance

My instance is on this AMI: amzn2-ami-hvm-2.0.20191116.0-x86_64-gp2 (ami-01f14919ba412de34) I want to install docker following this document so here is the output of my commands:

[ec2-user@ip-10-193-192-42 ~]$ sudo amazon-linux-extras install docker
Installing docker
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
Cleaning repos: amzn2-core amzn2extra-docker docker-ce-stable
12 metadata files removed
6 sqlite files removed
0 metadata files removed
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
amzn2-core                                               | 2.4 kB     00:00
amzn2extra-docker                                        | 1.3 kB     00:00
docker-ce-stable                                         | 3.5 kB     00:00
(1/6): amzn2-core/2/x86_64/group_gz                        | 2.6 kB   00:00
(2/6): amzn2-core/2/x86_64/updateinfo                      | 174 kB   00:00
(3/6): docker-ce-stable/x86_64/updateinfo                  |   55 B   00:00
(4/6): docker-ce-stable/x86_64/primary_db                  |  37 kB   00:00
(5/6): amzn2extra-docker/2/x86_64/primary_db               |  59 kB   00:00
(6/6): amzn2-core/2/x86_64/primary_db                      |  36 MB   00:00
Resolving Dependencies
--> Running transaction check
---> Package docker.x86_64 0:18.09.9ce-2.amzn2 will be installed
--> Processing Dependency: runc = 1.0.0 for package: docker-18.09.9ce-2.amzn2.x8                                                                                        6_64
--> Processing Dependency: containerd = 1.2.6 for package: docker-18.09.9ce-2.am                                                                                        zn2.x86_64
--> Processing Dependency: pigz for package: docker-18.09.9ce-2.amzn2.x86_64
--> Processing Dependency: libcgroup for package: docker-18.09.9ce-2.amzn2.x86_6                                                                                        4
--> Running transaction check
---> Package containerd.io.x86_64 0:1.2.10-3.2.el7 will be installed
--> Processing Dependency: container-selinux >= 2:2.74 for package: containerd.i                                                                                        o-1.2.10-3.2.el7.x86_64
---> Package libcgroup.x86_64 0:0.41-21.amzn2 will be installed
---> Package pigz.x86_64 0:2.3.4-1.amzn2.0.1 will be installed
--> Finished Dependency Resolution
Error: Package: containerd.io-1.2.10-3.2.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
Installation failed. Check that you have permissions to install.
[ec2-user@ip-10-193-192-42 ~]$

How to get this work?

EDIT

My instance is in an Autoscaling GRoup so I terminated the previous one and I tried to do docker install in the new one:

I got to install docker but when I run the command:

sudo service docker start

I logged out from the instance and I got an error window:

network error: software caused connection abort

Any clue why is this happening ?

like image 313
Souad Avatar asked Dec 06 '22 09:12

Souad


1 Answers

Just tried to install Docker to the exact same AMI and all went well. I guess you’re experiencing issues because of extra repo named docker-ce-stable. You don’t need it on Amazon Linux 2 AMI, so, as soon as you got SSH access to your new instance, execute:

sudo amazon-linux-extras install docker

and you should be ok.

like image 149
Alexey Dushechkin Avatar answered Dec 09 '22 16:12

Alexey Dushechkin