zypper在EC2上的suse sles docker容器作为主机失败

时间:2019-05-15 13:11:59

标签: linux docker amazon-ec2 containers suse

在作为主机的EC2 SUSE SLES 12.3 Linux实例上,我已经安装了docker。 我想为SUSE 12.3创建自定义docker映像。我已遵循官方文档https://www.suse.com/documentation/sles-12/singlehtml/book_sles_docker/book_sles_docker.html

我创建了一个Docker File,其中包含类似的说明

RUN zypper --gpg-auto-import-keys ref -s
RUN zypper ref -s
RUN zypper in gedit

但是每次执行docker构建时,我都会得到以下错误提示

Refreshing service 'container-suseconnect'.
Warning: Skipping service 'container-suseconnect' because of the above error.
All services have been refreshed.
Warning: There are no enabled repositories defined.
Use 'zypper addrepo' or 'zypper modifyrepo' commands to add or enable repositories.
Problem retrieving the repository index file for service 'container-suseconnect':
[container-suseconnect|file:/usr/lib/zypp/plugins/services/container-suseconnect]
Removing intermediate container eacd7fd77d35
 ---> 19390013d70b
Step 5/5 : RUN zypper in gedit
 ---> Running in 194557d71648
Refreshing service 'container-suseconnect'.
Problem retrieving the repository index file for service 'container-suseconnect':
[container-suseconnect|file:/usr/lib/zypp/plugins/services/container-suseconnect]
Warning: Skipping service 'container-suseconnect' because of the above error.
Warning: No repositories defined. Operating only with the installed resolvables. Nothing can be installed.
The command '/bin/sh -c zypper in gedit' returned a non-zero code: 6

我已经用Google搜索上述问题,并执行了Docker container-suseconnect failing中提到的以下步骤。我已经安装了博客中提到的必需证书。

我指的是AMAZON在孟买地区提供的SMT服务器。

Docker文件内容

FROM registry.suse.com/suse/sles12sp3

#Import the crt file of the SMT server    
ADD http://smt-ec2.susecloud.net/smt.crt /etc/pki/trust/anchors/smt.crt
RUN update-ca-certificates

RUN zypper --gpg-auto-import-keys ref -s

RUN zypper in gedit
Run zypper ref -s
#RUN zypper -n in vim

我需要在根据SUSE映像创建的docker容器中执行zypper指令

0 个答案:

没有答案