Image Stream是一组镜像的集合,可以在一个Image Stream中定义一些名称及标签(tag),并定义这些名字及标签指向的具体镜像。

使用Image Stream的目的是方便地将一组相关联的镜像进行整合管理和使用。

Openshift默认为用户定义了一系列开箱即用的Image Stream。
先登入自己openshift 账户:

oc login -u dev -p dev

注意: 先切换到自己的project :

oc project shp

[[email protected] ~]# curl -k https://raw.githubusercontent.com/openshift/origin/v3.6.0/examples/image-streams/image-streams-centos7.json|oc create -f - -n shp
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 38300  100 38300    0     0  41425      0 --:--:-- --:--:-- --:--:-- 41405
imagestream "httpd" created
imagestream "ruby" created
imagestream "nodejs" created
imagestream "perl" created
imagestream "php" created
imagestream "python" created
imagestream "wildfly" created
imagestream "mysql" created
imagestream "mariadb" created
imagestream "postgresql" created
imagestream "mongodb" created
imagestream "redis" created
imagestream "jenkins" created


[[email protected] ~]# oc get is
NAME              DOCKER REPO   TAGS                           UPDATED
httpd                           2.4,latest                     3 minutes ago
jenkins                         latest,2,1                     2 minutes ago
mariadb                         latest,10.1                    2 minutes ago
mongodb                         latest,3.2,2.6 + 1 more...     2 minutes ago
mysql                           5.7,5.6,5.5 + 1 more...        2 minutes ago
nodejs                          latest,6,4 + 1 more...         3 minutes ago
perl                            5.20,5.16,latest + 1 more...   3 minutes ago
php                             latest,7.0,5.6 + 1 more...     3 minutes ago
postgresql                      latest,9.5,9.4 + 1 more...     2 minutes ago
python                          latest,3.5,3.4 + 2 more...     3 minutes ago
redis                           latest,3.2                     2 minutes ago
ruby                            2.2,2.0,latest + 1 more...     3 minutes ago
wildfly                         10.0,9.0,8.1 + 2 more...       2 minutes ago
[[email protected] ~]#

然后登入openshift 看到很多imagestream 的模板建立好了:

before:openshift 添加Image Stream 模板

After:

openshift 添加Image Stream 模板

开心,下面就可以进行用模板进行对resource 进行CICD 实验啦。

相关文章: