【问题标题】:EC2 instance t2.micro unable to install dockerEC2 实例 t2.micro 无法安装 docker
【发布时间】:2020-08-08 20:11:30
【问题描述】:

我的内核版本:

[ec2-user@ip-172-31-15-171 ~]$ uname -a
Linux ip-172-31-15-171 4.14.158-101.185.amzn1.x86_64 #1 SMP Tue Dec 24 03:25:32 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

我试过了,但只得到:

[ec2-user@ip-172-31-15-171 ~]$ sudo yum install -y docker
Loaded plugins: priorities, update-motd, upgrade-helper
Resolving Dependencies
--> Running transaction check
---> Package docker.x86_64 0:19.03.6ce-3.57.amzn1 will be installed
--> Processing Dependency: runc >= 1.0.0 for package: docker-19.03.6ce-3.57.amzn1.x86_64
--> Processing Dependency: containerd >= 1.3.2 for package: docker-19.03.6ce-3.57.amzn1.x86_64
--> Processing Dependency: xfsprogs for package: docker-19.03.6ce-3.57.amzn1.x86_64
--> Processing Dependency: pigz for package: docker-19.03.6ce-3.57.amzn1.x86_64
--> Processing Dependency: libseccomp.so.2()(64bit) for package: docker-19.03.6ce-3.57.amzn1.x86_64
--> Running transaction check
---> Package containerd.io.x86_64 0:1.2.13-3.1.el7 will be installed
--> Processing Dependency: container-selinux >= 2:2.74 for package: containerd.io-1.2.13-3.1.el7.x86_64
--> Processing Dependency: systemd for package: containerd.io-1.2.13-3.1.el7.x86_64
--> Processing Dependency: systemd for package: containerd.io-1.2.13-3.1.el7.x86_64
---> Package libseccomp.x86_64 0:2.3.1-2.4.amzn1 will be installed
---> Package pigz.x86_64 0:2.3.3-1.6.amzn1 will be installed
---> Package xfsprogs.x86_64 0:4.5.0-18.23.amzn1 will be installed
--> Finished Dependency Resolution
Error: Package: containerd.io-1.2.13-3.1.el7.x86_64 (docker-ce-stable)
           Requires: systemd
Error: Package: containerd.io-1.2.13-3.1.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

我google了很多,有人说ami不支持systemctl。我不知道弄清楚。 对于container-selinux,我试过这个,但它也不起作用。

sudo yum install -q -y http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.107-1.el7_6.noarch.rpm

我也试过amazon official document提供的命令

[ec2-user@ip-172-31-15-171 ~]$ sudo amazon-linux-extras install docker
sudo: amazon-linux-extras: command not found

尝试安装它:

[ec2-user@ip-172-31-15-171 ~]$ sudo yum install -y amazon-linux-extras
Loaded plugins: priorities, update-motd, upgrade-helper
amzn-main                                                                                                                                                              | 2.1 kB  00:00:00     
amzn-updates                                                                                                                                                           | 2.5 kB  00:00:00     
No package amazon-linux-extras available.
Error: Nothing to do

没有包,这个实例有什么问题!

沮丧。希望对您有所帮助。

【问题讨论】:

标签: linux amazon-web-services docker amazon-ec2


【解决方案1】:

问题的最可能原因是使用了 Amazon Linux 1 (amzn1)。 Amazon Linux 1 使用 sysvinit,而不是 systemd

推荐的解决方案是使用支持systemd的Amazon Linux 2

【讨论】:

  • 用amzn1可以安装docker吗?
  • 也许有,我不知道。您的问题并不表明使用 Amazon Linux 1 是一项要求。 AL1 将仅支持到 this year 的末尾。所以如果不是现在,那么在不久的将来无论如何都必须切换到 AL2。
猜你喜欢
  • 1970-01-01
  • 2014-12-29
  • 2015-09-13
  • 2018-01-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-12-26
  • 2016-05-19
相关资源
最近更新 更多