docker-machine,docker-compose 和 google cloud
docker-machine, docker-compose and google cloud
我想在 google cloud
中创建一个 docker-machine
。
我使用以下命令:
docker-machine create --driver google --google-project test-project --google-machine-type n1-standard-4 test-shiny
然后,我将那台机器置于活动状态:
$ eval "$(docker-machine env cinepolis-shiny)"
它成功了:
$ docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
test-shiny * google Running tcp://XX.XXX.XX.XX:2376 v1.10.1
dev - virtualbox Stopped Unknown
然后我尝试使用 docker-compose --verbose up -d
(这在 dev
和本地有效)并且发生以下情况:
$ docker-compose --verbose up -d
compose.config.config.find: Using configuration files: ./docker-compose.yml
docker.auth.auth.load_config: Trying /home/nanounanue/.docker/config.json
docker.auth.auth.load_config: File doesn't exist
docker.auth.auth.load_config: Trying /home/nanounanue/.dockercfg
docker.auth.auth.load_config: File doesn't exist - returning empty config
compose.cli.command.get_client: docker-compose version 1.5.2, build 7240ff3
docker-py version: 1.5.0
CPython version: 2.7.9
OpenSSL version: OpenSSL 1.0.1e 11 Feb 2013
compose.cli.command.get_client: Docker base_url: https://23.236.56.24:2376
compose.cli.command.get_client: Docker version: KernelVersion=4.2.0-18-generic, Os=linux, BuildTime=2016-02-11T19:32:54.005620765+00:00, ApiVersion=1.22, Version=1.10.1, GitCommit=9e83765, Arch=amd64, GoVersion=go1.5.3
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=True, filters={u'label': [u'com.docker.compose.project=docker', u'com.docker.compose.service=cinepolisdata', u'com.docker.compose.oneoff=False']})
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 0 items)
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=True)
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 0 items)
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=True, filters={u'label': [u'com.docker.compose.project=docker', u'com.docker.compose.service=server', u'com.docker.compose.oneoff=False']})
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 0 items)
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=True)
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 0 items)
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=True, filters={u'label': [u'com.docker.compose.project=docker', u'com.docker.compose.service=cinepolisdata', u'com.docker.compose.oneoff=False']})
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 0 items)
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=True)
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 0 items)
compose.project._get_convergence_plans: server has upstream changes (cinepolisdata)
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=True, filters={u'label': [u'com.docker.compose.project=docker', u'com.docker.compose.service=server', u'com.docker.compose.oneoff=False']})
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 0 items)
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=True)
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 0 items)
compose.cli.verbose_proxy.proxy_callable: docker inspect_image <- (u'docker_cinepolisdata')
compose.service.build: Building cinepolisdata
compose.cli.verbose_proxy.proxy_callable: docker build <- (pull=False, nocache=False, stream=True, tag=u'docker_cinepolisdata', forcerm=False, rm=True, path='/home/nanounanue/proyectos/klustera/docker/data', dockerfile=None)
docker.api.build._set_auth_headers: Looking for auth config
docker.api.build._set_auth_headers: No auth config in memory - loading from filesystem
docker.auth.auth.load_config: Trying /home/nanounanue/.docker/config.json
docker.auth.auth.load_config: File doesn't exist
docker.auth.auth.load_config: Trying /home/nanounanue/.dockercfg
docker.auth.auth.load_config: File doesn't exist - returning empty config
docker.api.build._set_auth_headers: No auth config found
并且在这一点上永远挂起。
所以,我做错了什么?如何生成 .dockercfg
文件?
能指点一下吗?
请注意,我可以毫无问题地使用 docker-machine ssh ...
和 docker run busybox echo 'Hello, World!'
要创建 .dockercfg,您需要 运行
docker login
可以在 article 中找到更多信息。
我想在 google cloud
中创建一个 docker-machine
。
我使用以下命令:
docker-machine create --driver google --google-project test-project --google-machine-type n1-standard-4 test-shiny
然后,我将那台机器置于活动状态:
$ eval "$(docker-machine env cinepolis-shiny)"
它成功了:
$ docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
test-shiny * google Running tcp://XX.XXX.XX.XX:2376 v1.10.1
dev - virtualbox Stopped Unknown
然后我尝试使用 docker-compose --verbose up -d
(这在 dev
和本地有效)并且发生以下情况:
$ docker-compose --verbose up -d
compose.config.config.find: Using configuration files: ./docker-compose.yml
docker.auth.auth.load_config: Trying /home/nanounanue/.docker/config.json
docker.auth.auth.load_config: File doesn't exist
docker.auth.auth.load_config: Trying /home/nanounanue/.dockercfg
docker.auth.auth.load_config: File doesn't exist - returning empty config
compose.cli.command.get_client: docker-compose version 1.5.2, build 7240ff3
docker-py version: 1.5.0
CPython version: 2.7.9
OpenSSL version: OpenSSL 1.0.1e 11 Feb 2013
compose.cli.command.get_client: Docker base_url: https://23.236.56.24:2376
compose.cli.command.get_client: Docker version: KernelVersion=4.2.0-18-generic, Os=linux, BuildTime=2016-02-11T19:32:54.005620765+00:00, ApiVersion=1.22, Version=1.10.1, GitCommit=9e83765, Arch=amd64, GoVersion=go1.5.3
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=True, filters={u'label': [u'com.docker.compose.project=docker', u'com.docker.compose.service=cinepolisdata', u'com.docker.compose.oneoff=False']})
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 0 items)
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=True)
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 0 items)
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=True, filters={u'label': [u'com.docker.compose.project=docker', u'com.docker.compose.service=server', u'com.docker.compose.oneoff=False']})
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 0 items)
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=True)
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 0 items)
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=True, filters={u'label': [u'com.docker.compose.project=docker', u'com.docker.compose.service=cinepolisdata', u'com.docker.compose.oneoff=False']})
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 0 items)
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=True)
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 0 items)
compose.project._get_convergence_plans: server has upstream changes (cinepolisdata)
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=True, filters={u'label': [u'com.docker.compose.project=docker', u'com.docker.compose.service=server', u'com.docker.compose.oneoff=False']})
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 0 items)
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=True)
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 0 items)
compose.cli.verbose_proxy.proxy_callable: docker inspect_image <- (u'docker_cinepolisdata')
compose.service.build: Building cinepolisdata
compose.cli.verbose_proxy.proxy_callable: docker build <- (pull=False, nocache=False, stream=True, tag=u'docker_cinepolisdata', forcerm=False, rm=True, path='/home/nanounanue/proyectos/klustera/docker/data', dockerfile=None)
docker.api.build._set_auth_headers: Looking for auth config
docker.api.build._set_auth_headers: No auth config in memory - loading from filesystem
docker.auth.auth.load_config: Trying /home/nanounanue/.docker/config.json
docker.auth.auth.load_config: File doesn't exist
docker.auth.auth.load_config: Trying /home/nanounanue/.dockercfg
docker.auth.auth.load_config: File doesn't exist - returning empty config
docker.api.build._set_auth_headers: No auth config found
并且在这一点上永远挂起。
所以,我做错了什么?如何生成 .dockercfg
文件?
能指点一下吗?
请注意,我可以毫无问题地使用 docker-machine ssh ...
和 docker run busybox echo 'Hello, World!'
要创建 .dockercfg,您需要 运行
docker login
可以在 article 中找到更多信息。