Openshift&;docker-我可以使用哪个注册表进行Minishift?

Openshift&;docker-我可以使用哪个注册表进行Minishift?,docker,openshift,minishift,Docker,Openshift,Minishift,将Openshift作为容器即服务使用很容易,请参阅。因此,通过docker客户端,我可以使用Openshift 我想用Minishift在我的笔记本电脑上工作。这是你笔记本电脑上Openshift的本地版本 我应该将哪个docker注册表与Minishift结合使用?我想Minishift没有自己的注册表 因此,我想: $ maven clean install -- building the application $ oc login to your minishift environme

将Openshift作为容器即服务使用很容易,请参阅。因此,通过docker客户端,我可以使用Openshift

我想用Minishift在我的笔记本电脑上工作。这是你笔记本电脑上Openshift的本地版本

我应该将哪个docker注册表与Minishift结合使用?我想Minishift没有自己的注册表

因此,我想:

$ maven clean install -- building the application
$ oc login to your minishift environment
$ docker build -t myproject/mynewapplication:latest
$ docker tag -- ?? normally to a openshift docker registry entry
$ docker push -- ?? to a local docker registry?
$ on 1st time: $ oc new-app mynewapplication
$ on updates: $ oc rollout latest dc/mynewapplication-n myproject

有一个内部图像注册表。您可以登录到它并按您的建议推送图像。你只需要知道地址和你需要的证件。详情请参阅:


我只使用docker和
oc集群
,两者非常相似。部署的内部注册表在172.30.0.0/16空间中有一个地址(即默认服务网络)

在我的示例中,路由是
docker registry default.127.0.0.1.nip.io

通过此路由,您可以使用开发人员帐户和令牌登录

$oc login -u developer
$docker login docker-registry-default.127.0.0.1.nip.io -p $(oc whoami -t) -u developer
Login Succeeded
注意:
oc cluster up
默认为短暂的;文档可以提供有关如何使此设置持久化的说明

另外一个注意事项是,如果您想让OpenShift尝试使用它的一些本地构建器,您可以简单地运行
ocnewapp--源代码目录中的名称

$ cat Dockerfile 
FROM centos:latest

$ oc new-app . --name=app1
--> Found Docker image 49f7960 (5 days old) from Docker Hub for "centos:latest"

    * An image stream will be created as "centos:latest" that will track the source image
    * A Docker build using binary input will be created
      * The resulting image will be pushed to image stream "app1:latest"
      * A binary build was created, use 'start-build --from-dir' to trigger a new build
    * This image will be deployed in deployment config "app1"
    * 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/app1 --port=[port]' later
    * WARNING: Image "centos:latest" runs as the 'root' user which may not be permitted by your cluster administrator

--> Creating resources ...
    imagestream "centos" created
    imagestream "app1" created
    buildconfig "app1" created
    deploymentconfig "app1" created
--> Success
    Build scheduled, use 'oc logs -f bc/app1' to track its progress.
    Run 'oc status' to view your app.

正如我在这篇文章中所理解的,您的答案是关于Openshift的内部注册表。当我使用Minishift时,我要寻找的是本地注册表。Minishift环境中是否有已知的注册表?我想每次重新开始后,它都会被扔掉?Minishift是OpenShift。出于您的目的,它看起来是相同的,您使用相同的过程访问内部注册表。如果您想对实现细节有所挑剔,那么Minishift将在VM中运行。在该VM中有一个本地docker守护程序实例。然后,
oc cluster up
在虚拟机中运行。它将使用VM中的本地docker实例作为注册表。重启时不会丢弃它,因为它是VM的一部分。它不在您自己的主机上使用本地docker daemon实例。无论哪种方式,对于Minishift,获取使用映像注册表所需详细信息的快捷方式是运行
Minishift docker env
,然后执行它告诉您的操作。对我来说不起作用。运行
docker login
命令时,我收到一个错误:来自守护进程的错误响应:get:x509:证书对*.router.default.svc.cluster.local、router.default.svc.cluster.local有效,而不是docker-registry-default.192.168.64.2.nip.iot。解决方案是改为使用此命令:
docker login-u developer-p$(oc whoami-t)$(minishift openshift注册表)
请参阅:
$oc login -u developer
$docker login docker-registry-default.127.0.0.1.nip.io -p $(oc whoami -t) -u developer
Login Succeeded
$ cat Dockerfile 
FROM centos:latest

$ oc new-app . --name=app1
--> Found Docker image 49f7960 (5 days old) from Docker Hub for "centos:latest"

    * An image stream will be created as "centos:latest" that will track the source image
    * A Docker build using binary input will be created
      * The resulting image will be pushed to image stream "app1:latest"
      * A binary build was created, use 'start-build --from-dir' to trigger a new build
    * This image will be deployed in deployment config "app1"
    * 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/app1 --port=[port]' later
    * WARNING: Image "centos:latest" runs as the 'root' user which may not be permitted by your cluster administrator

--> Creating resources ...
    imagestream "centos" created
    imagestream "app1" created
    buildconfig "app1" created
    deploymentconfig "app1" created
--> Success
    Build scheduled, use 'oc logs -f bc/app1' to track its progress.
    Run 'oc status' to view your app.