简体   繁体   English

如何在 AWS Linux 上安装 Skopeo?

[英]How to install Skopeo on AWS Linux?

I am trying to install skopeo on AWS Linux but getting error - No package found.我正在尝试在AWS Linux上安装skopeo但出现错误 - No package found.

[root@master ~]# yum -y install skopeo
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
amzn2-core                                                                                                               | 3.7 kB  00:00:00
228 packages excluded due to repository priority protections
No package skopeo available.
Error: Nothing to do
[root@master ~]#

How can I install Skopeo on AWS Linux?如何在 AWS Linux 上安装 Skopeo?

Is there any other tool available on AWS linux which helps to inspect images? AWS linux 上是否有任何其他工具可以帮助检查图像?

Edited: This package is available in the CentOS-7 Extras repo.已编辑:这个 package 可在 CentOS-7 Extras 软件库中找到。 Enabling this repo on Amazon Linux 2 may have unintended consequences.在 Amazon Linux 2 上启用此存储库可能会产生意想不到的后果。 You may want to consider running an EC2 instance of CentOS or RHEL to manage this workload.您可能需要考虑运行 CentOS 或 RHEL 的 EC2 实例来管理此工作负载。 If you want to live on the edge IMO, do the below at your own risk.如果您想生活在 IMO 的边缘,请自行承担以下风险。

You can either download (wget or curl) and install the package manually with rpm, and resolve the dependencies, or you can configure the CentOS-7 repository and try to install directly with Yum.您可以下载(wget 或 curl)并使用 rpm 手动安装 package,并解决依赖关系,或者您可以配置 CentOS-7 存储库并尝试直接使用 Yum 安装。

In order to install packages from the CentOS-7 Extras repo, you need to download the GPG key:要从 CentOS-7 Extras 软件库安装组件,你需要下载 GPG 金钥:

cd /etc/pki/rpm-gpg/
curl -s https://www.centos.org/keys/RPM-GPG-KEY-CentOS-7

You will then need to create a repo file in /etc/yum.repos.d:然后您需要在 /etc/yum.repos.d 中创建一个 repo 文件:

[extras]
name=CentOS-7 - Extras
mirrorlist=http://mirrorlist.centos.org/?release=7&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/7/extras/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
priority=1

This only gets you part way there:这只会让你走到那里:

# yum --disablerepo='*' --enablerepo='extras' search skopeo
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
============================================================================================ N/S matched: skopeo =============================================================================================
skopeo.x86_64 : Inspect container images and repositories on registries
skopeo-containers.x86_64 : Configuration files for working with image signature

containers-common has a dependency on subscription-manager which is part of the CentOS-7 core packages, and there are related dependencies. containers-common 对 subscription-manager 有依赖性,subscription-manager 是 CentOS-7 核心组件的一部分,并且有相关的依赖性。 You can download these core packages here:您可以在此处下载这些核心包:

http://mirror.centos.org/centos/7/os/x86_64/Packages/ http://mirror.centos.org/centos/7/os/x86_64/Packages/

You will need the following packages:您将需要以下软件包:

cd /tmp
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/subscription-manager-1.24.42-1.el7.centos.x86_64.rpm
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/subscription-manager-plugin-ostree-1.24.42-1.el7.centos.x86_64.rpm
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/subscription-manager-rhsm-1.24.42-1.el7.centos.x86_64.rpm
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/subscription-manager-rhsm-certificates-1.24.42-1.el7.centos.x86_64.rpm
wget python-syspurpose-1.24.42-1.el7.centos.x86_64.rpm
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/python-syspurpose-1.24.42-1.el7.centos.x86_64.rpm
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/python-dmidecode-3.12.2-4.el7.x86_64.rpm

You will also need to install dependencies available from Amazon Linux 2:您还需要安装 Amazon Linux 2 提供的依赖项:

yum install dbus-python pygobject3-base python-decorator python-dmidecode python-ethtool python-inotify python-syspurpose python-gobject-base gobject-introspection

Now you can install the manually downloaded RPMs:现在您可以安装手动下载的 RPM:

rpm -i *rpm

I completed all of these steps on a test server, and everything installed.我在测试服务器上完成了所有这些步骤,并安装了所有东西。 I'm not familiar with the Skopeo tools, so I can't speak as to whether or not it will work.我不熟悉 Skopeo 工具,所以我不能说它是否有效。

Once word of caution, when you add third party repos to an OS, you risk unintentional upgrades of other packages during a normal OS upgrade, and this can break things.请注意,当您将第三方存储库添加到操作系统时,您可能会在正常的操作系统升级期间冒着意外升级其他软件包的风险,这可能会破坏一切。

You can avoid this by setting "enable = 0" in the Yum repo files, and enabling the repo at the command line ONLY when you want to update those packages (ie "yum --enablerepo=remi update skopeo")您可以通过在 Yum 存储库文件中设置“enable = 0”来避免这种情况,并且仅当您想要更新这些软件包时才在命令行启用存储库(即“yum --enablerepo=remi update skopeo”)

OK, hope this helps.好的,希望这有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM