本文介绍了如何在Amazon Linux2上安装Docker的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为Amazon ECR创建docker镜像.但 yum 在我的Amazon Linux2中找不到它.

I wanna create docker image for Amazon ECR.but yum can't find it in my Amazon Linux2.

[root@*** ~]# yum install -y docker
Loaded plugins: amazon-id, rhui-lb, search-disabled-repos
No package docker available.
Error: Nothing to do

接下来,我尝试使用amazon-linux-extras.

Next, I tried to use amazon-linux-extras.

但是也没有找到amazon-linux-extras.

but amazon-linux-extras is not found, too.

[root@*** ~]# amazon-linux-extras install docker -y
-bash: amazon-linux-extras: command not found
[root@*** ~]# find / -name 'amazon-linux-extras'
[root@*** ~]$ cat /proc/version
Linux version 4.14.77-81.59.amzn2.x86_64 (mockbuild@ip-10-0-1-59) (gcc version 7.3.1 20180303 (Red Hat 7.3.1-5) (GCC)) #1 SMP Mon Nov 12 21:32:48 UTC 2018

如何安装amazon-linux-extras或创建docker映像?

How can I install amazon-linux-extras or create docker image?

推荐答案

对不起,这是我的误会.我的操作系统是Redhat Linux.我可以通过

So sorry, it was my misunderstanding.My OS is Redhat Linux.I get to install docker by

yum-config-manager --enable rhui-REGION-rhel-server-extras
yum -y install docker
systemctl start docker
docker version

这篇关于如何在Amazon Linux2上安装Docker的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 19:12