将Docker图像从公共注册表导入OpenShift [英] Importing Docker Images Images From The Public Registry Into OpenShift

查看:284
本文介绍了将Docker图像从公共注册表导入OpenShift的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从此处部署Ubuntu映像在OpenShift Online(下一代)。这些是我这样做的步骤

I am trying to deploy an Ubuntu Image from the here on OpenShift Online (Next Generation). These are the steps I followed in doing so

$ oc new-project test
$ oc new-app jedisct1/phusion-baseimage-latest

I then deployed from the WebConsole

但是在pod页面上获得失败的部署和错误状态image pull back off。任何特别的事情,我可能在做错?

However I get a failed deploy and an error status of "image pulled back off" on the pod page. Any particular thing that I may be doing wrong?

以下是整个处理的日志。

Below are the logs of the entire proccess.

root@home:~# oc new-project test
Now using project "test" on server "https://api.preview.openshift.com:443".

You can add applications to this project with the 'new-app' command. For example, try:

    $ oc new-app centos/ruby-22-centos7~https://github.com/openshift/ruby-hello-world.git

to build a new hello-world application in Ruby.

root@home:~# oc new-app jedisct1/phusion-baseimage-latest
--> Found Docker image 7ff0885 (14 hours old) from Docker Hub for "jedisct1/phusion-baseimage-latest"

    * An image stream will be created as "phusion-baseimage-latest:latest" that will track this image
    * This image will be deployed in deployment config "phusion-baseimage-latest"
    * The image does not expose any ports - if you want to load balance or send traffic to this component
      you will need to create a service with 'expose dc/phusion-baseimage-latest --port=[port]' later
    * WARNING: Image "phusion-baseimage-latest" runs as the 'root' user which may not be permitted by your cluster administrator

--> Creating resources with label app=phusion-baseimage-latest ...
    imagestream "phusion-baseimage-latest" created
    deploymentconfig "phusion-baseimage-latest" created
--> Success
    Run 'oc status' to view your app.

root@home:~# oc status
In project test on server https://api.preview.openshift.com:443

dc/phusion-baseimage-latest deploys istag/phusion-baseimage-latest:latest
  deployment #1 pending on image or update

1 warning identified, use 'oc status -v' to see details.

root@home:~# oc status -v
In project test on server https://api.preview.openshift.com:443

dc/phusion-baseimage-latest deploys istag/phusion-baseimage-latest:latest
  deployment #1 pending on image or update

Warnings:
  * dc/phusion-baseimage-latest has no readiness probe to verify pods are ready to accept traffic or ensure deployment is successful.
    try: oc set probe dc/phusion-baseimage-latest --readiness ...

View details with 'oc describe <resource>/<name>' or list everything with 'oc get all'.

root@home:~# oc status -v
In project test on server https://api.preview.openshift.com:443

dc/phusion-baseimage-latest deploys istag/phusion-baseimage-latest:latest
  deployment #2 running for 2 minutes - 1 pod


推荐答案

1. using Docker < 1.10 pull the image

2. tag it either as

     docker.io/<yourname>/imagename

     or

     ${INTERNAL_DOCKER_REGISTRY_IP}/openshift/imagename

3. push it using the same tag

4. deploy from that

使用docker< 1.10,您可能会确定推送的图像将是可以由当前注册表版本和docker 1.9导入的模式v1。

Using docker < 1.10, you may be sure that the pushed image will be of schema v1 which is importable both by current registry version and docker 1.9.

拉动图像没有问题,因为Docker集线器将其转换为模式v1,该模式与集线器上的消息不同。因此,如果您尝试使用此摘要,您将失败,因为它不存储在集线器上。因此,部署者将失败,因为docker无法提取给定的摘要。

Pulling images is no problem, because Docker hub converts it on the fly to schema v1 which has a different digest than the one on the hub. So if you try to pull using this digest you will fail because it isn't stored on the hub. Thus the deployer will fail because docker fails to pull given digest.

基本上,只要您使用docker& 1.10,所以你可以确定生成的图像清单将是模式v1 - 这样一个清单可以被任何版本的OpenShift和docker安全地使用。

Basically, you can push it anywhere as long as you use docker < 1.10 so you can be sure that the resulting image manifest will be of schema v1 - such a manifest can be safely consumed by the OpenShift and docker of any version.

替代方法

您还可以将其推送到您想要的任何码头服务器版本的OpenShift Online。因为OpenShift的注册表只存储v1模式。然后参考推送的图像而不是Docker Hub上的原始源。

You can also push it to OpenShift Online with any docker version you want. Because OpenShift's registry stores only v1 schema. Then refer to the pushed image instead of original source on the Docker Hub.

这篇关于将Docker图像从公共注册表导入OpenShift的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆