centos rancher 通过本机 docker images 新增container

时间:2021-12-17 16:13:16

示例目标: 将centos 本地的docker image ,通过rancher 进行 add container

相关步骤:

step 1 : rancher 所在 centos 主机,有相应的 docker images ,如 testapi:v1

step 2 :浏览器访问rancher ui  -> infrastructure -> Containers -> Add Container

step 3 : 输入Name , Select Images = testapi:v1 ,进行create 保存

step 4 : 会出现类似如下错误提示

Error (Image [index.docker.io/testapi:v1] failed to pull: repository docker.io/testapi not found: does not exist or no pull access)

step 5 : 回到centos 主机,通过 docker tag 进行类似如下处理 (模拟已将docker.io/testapi 下载到本机的效果)

 #docker tag testapi:v1 docker.io/testapi:v1

进行本地镜像查看

#docker images

step 6 : 回到rancher ui,删掉刚才添加失败的testapi容器,

重新进行如step 3的添加,

这次就不会再出现step 4的error。

rancher 直接从本地镜像创建容器完成。

供参考