OpenShift Container Platform 4.2 镜像像存储库 储库是一个相关容器镜像和标识它们的标签(tag)的集合。例如,OpenShift Jenkins 镜像位于以 下存储库中: docker.io/openshift/jenkins-2-centos7 3.5. 镜像标签 镜像标签(tag)是应用于存储库中容器镜像的标签,用于将特定镜像与镜像流中的其他镜像区分开来。 标签通常代表某种版本号。例如,这里的 v3.11.59-2 是标签: SHA(安全哈希算法)代码,可用于拉取(pull)镜像。SHA 镜像 ID 不能更改。特定 SHA 标 识符会始终引用完全相同的容器镜像内容。例如: docker.io/openshift/jenkins-2-centos7@sha256:ab312bda324 3.7. 使用镜像流 镜像流及其关联标签提供了一个用于从 OpenShift Container Platform 中引用容器镜像的抽象集。镜像流 命令,则可复制以下 Makefile 模板,并将 IMAGE_NAME 参数替换为您的镜像名 称。 Makefile 示例 示例 IMAGE_NAME = openshift/ruby-20-centos7 CONTAINER_ENGINE := $(shell command -v podman 2> /dev/null | echo docker) build: ${CONTAINER_ENGINE}0 码力 | 92 页 | 971.35 KB | 1 年前3
OpenShift Container Platform 4.7 镜像的其他镜像区分开来。 标签通常代表某种版本号。例如,这里 :v3.11.59-2 是标签: registry.redhat.io docker.io/openshift/jenkins-2-centos7 registry.access.redhat.com/openshift3/jenkins-2-rhel7:v3.11.59-2 OpenShift Container Platform registry.redhat.io 或 Quay.io。 OpenShift Container Platform 集群中的其他镜像流。 docker.io/openshift/jenkins-2-centos7@sha256:ab312bda324 第 第 1 章 章 镜 镜像概述 像概述 7 当您定义引用镜像流标签的对象时,如构建或部署配置,您将指向镜像流标签而不是存储库。您在构建或 部署应用程序时,OpenShift 命令,则可复制以下 Makefile 模板,并将 IMAGE_NAME 参数替换为您的镜像名 称。 Makefile 示例 示例 IMAGE_NAME = openshift/ruby-20-centos7 CONTAINER_ENGINE := $(shell command -v podman 2> /dev/null | echo docker) build: ${CONTAINER_ENGINE}0 码力 | 123 页 | 1.20 MB | 1 年前3
OpenShift Container Platform 4.14 镜像您可以向镜像添加其他标签。例如,可为镜像分配 :v3.11.59-2 和 :latest 标签。 registry.redhat.io docker.io/openshift/jenkins-2-centos7 registry.access.redhat.com/openshift3/jenkins-2-rhel7:v3.11.59-2 OpenShift Container Platform Platform 集群中的其他镜像流。 当您定义引用镜像流标签的对象时,如构建或部署配置,您将指向镜像流标签而不是存储库。您在构建或 docker.io/openshift/jenkins-2-centos7@sha256:ab312bda324 第 第 1 章 章 镜 镜像概述 像概述 5 当您定义引用镜像流标签的对象时,如构建或部署配置,您将指向镜像流标签而不是存储库。您在构建或 部署应用程序时,OpenShift 命令,则可复制以下 Makefile 模板,并将 IMAGE_NAME 参数替换为您的镜像名 称。 Makefile 示例 示例 IMAGE_NAME = openshift/ruby-20-centos7 CONTAINER_ENGINE := $(shell command -v podman 2> /dev/null | echo docker) build: ${CONTAINER_ENGINE}0 码力 | 118 页 | 1.13 MB | 1 年前3
OpenShift Container Platform 4.4 构建(build)strategy: 5 sourceStrategy: from: kind: "ImageStreamTag" name: "ruby-20-centos7:latest" output: 6 to: kind: "ImageStreamTag" name: "origin-ruby-sample:latest" 个源。如需详细信息,请参阅每种源类型的文档。 strategy 部分描述用于执行构建的构建策略。您可以在此处指定 Source、Docker 或 Custom 策 略。示例中使用了 ruby-20-centos7 容器镜像,Source-To-Image 使用该镜像来进行应用程序构 建。 成功构建容器镜像后,它将被推送到 output 部分中描述的存储库。 postCommit 部分定义一个可选构建 /usr/lib/somefile.jar contextDir: "app/dir" 3 dockerfile: "FROM centos:7\nRUN yum install -y httpd" 4 source: dockerfile: "FROM centos:7\nRUN yum install -y httpd" 1 source: git: uri: https://github0 码力 | 101 页 | 1.12 MB | 1 年前3
OpenShift Container Platform 4.13 CI/CD拥有多 个源。详情请参阅每种源类型的文档。 strategy 部分描述用于执行构建的构建策略。您可以在此处指定 Source、Docker 或 Custom 策 略。本例使用 ruby-20-centos7 容器镜像, Source-to-image(S2I)用于应用程序构建。 成功构建容器镜像后,它将被推送到 output 部分中描述的存储库。 postCommit 部分定义一个可选构建 hook。 strategy: 5 sourceStrategy: from: kind: "ImageStreamTag" name: "ruby-20-centos7:latest" output: 6 to: kind: "ImageStreamTag" name: "origin-ruby-sample:latest" app/dir/injected/dir 2 sourcePath: /usr/lib/somefile.jar contextDir: "app/dir" 3 dockerfile: "FROM centos:7\nRUN yum install -y httpd" 4 第 第 2 章 章 构 构建( 建(BUILD) ) 7 1 1 2 3 提供 dockerfile 值时,此字段的内容将写到磁盘上,存为名为0 码力 | 129 页 | 1.37 MB | 1 年前3
OpenShift Container Platform 4.10 CLI 工具(joe-project) service database (172.30.43.12:5434 -> 3306) database deploys docker.io/openshift/mysql-55-centos7:latest #1 deployed 25 minutes ago - 1 pod service frontend (172.30.159.137:5432 -> 8080) origin-ruby-sample:latest <- builds https://github.com/openshift/ruby-hello-world with joe-project/ruby-20-centos7:latest #1 deployed 22 minutes ago - 2 pods To see more information about a service or deployment docker.io/library/centos:7 --path /bin/bash:. # Extract all .repo files from the image's /etc/yum.repos.d/ folder into the current directory oc image extract docker.io/library/centos:7 --path /etc/yum0 码力 | 120 页 | 1.04 MB | 1 年前3
OpenShift Container Platform 4.8 CLI 工具(joe-project) service database (172.30.43.12:5434 -> 3306) database deploys docker.io/openshift/mysql-55-centos7:latest #1 deployed 25 minutes ago - 1 pod service frontend (172.30.159.137:5432 -> 8080) origin-ruby-sample:latest <- builds https://github.com/openshift/ruby-hello-world with joe-project/ruby-20-centos7:latest #1 deployed 22 minutes ago - 2 pods To see more information about a service or deployment docker.io/library/centos:7 --path /bin/bash:. # Extract all .repo files from the image's /etc/yum.repos.d/ folder into the current directory oc image extract docker.io/library/centos:7 --path /etc/yum0 码力 | 152 页 | 1.24 MB | 1 年前3
OpenShift Container Platform 4.13 CLI 工具(joe-project) service database (172.30.43.12:5434 -> 3306) database deploys docker.io/openshift/mysql-55-centos7:latest #1 deployed 25 minutes ago - 1 pod service frontend (172.30.159.137:5432 -> 8080) origin-ruby-sample:latest <- builds https://github.com/openshift/ruby-hello-world with joe-project/ruby-20-centos7:latest #1 deployed 22 minutes ago - 2 pods To see more information about a service or deployment docker.io/library/centos:7 --path /bin/bash:. # Extract all .repo files from the image's /etc/yum.repos.d/ folder into the current directory oc image extract docker.io/library/centos:7 --path /etc/yum0 码力 | 128 页 | 1.11 MB | 1 年前3
OpenShift Container Platform 4.9 构建应用程序库的镜像。请注意,如果进行这一操作,就不会执行构建策略检测和语言检测。 例如,使用 myproject/my-ruby 镜像流以及位于远程存储库中的源: 使用 openshift/ruby-20-centos7:latest 容器镜像流以及本地仓库中的源: 注意 注意 语言检测需要在本地安装 Git 客户端,以便克隆并检查您的存储库。如果 Git 不可用,您 可以使用〜 myproject/my-ruby~https://github.com/openshift/ruby-hello-world.git $ oc new-app openshift/ruby-20-centos7:latest~/home/user/code/my-ruby-app $ oc new-app mysql $ oc new-app myregistry:5000/example/myimage 变量 量 从模板、源或镜像生成应用程序时,您可以在运行时使用 --build-env 参数将环境变量传递给构建容器: $ oc new-app openshift/postgresql-92-centos7 \ -e POSTGRESQL_USER=user \ -e POSTGRESQL_DATABASE=db \ -e POSTGRESQL_PASSWORD=password 0 码力 | 184 页 | 3.36 MB | 1 年前3
OpenShift Container Platform 4.10 构建应用程序库的镜像。请注意,如果进行这一操作,就不会执行构建策略检测和语言检测。 例如,使用 myproject/my-ruby 镜像流以及位于远程存储库中的源: 使用 openshift/ruby-20-centos7:latest 容器镜像流以及本地仓库中的源: 注意 注意 语言检测需要在本地安装 Git 客户端,以便克隆并检查您的存储库。如果 Git 不可用,您 可以使用〜 〜 myproject/my-ruby~https://github.com/openshift/ruby-hello-world.git $ oc new-app openshift/ruby-20-centos7:latest~/home/user/code/my-ruby-app $ oc new-app mysql $ oc new-app myregistry:5000/example/myimage 变量 量 从模板、源或镜像生成应用程序时,您可以在运行时使用 --build-env 参数将环境变量传递给构建容器: $ oc new-app openshift/postgresql-92-centos7 \ -e POSTGRESQL_USER=user \ -e POSTGRESQL_DATABASE=db \ -e POSTGRESQL_PASSWORD=password 0 码力 | 198 页 | 3.62 MB | 1 年前3
共 25 条
- 1
- 2
- 3













