Tag: google compute engine

将Google服务帐户凭据传递给Docker

我的使用案例与其他使用这个问题的使用案例稍有不同,所以稍加说明: 我在Google Cloud上工作,并有一个“dockerized”的Django应用程序。 部分应用程序取决于使用gsutil将文件移入/移出Google存储分区。 由于各种原因,我们不希望使用Google Container Engine来pipe理我们的容器。 相反,我们想通过启动额外的Google Compute虚拟机进行横向扩展,而后者又将运行此Docker容器。 类似于https://cloud.google.com/python/tutorials/bookshelf-on-compute-engine,除了我们将使用容器而不是拉一个git仓库。 虚拟机将从一个基本的Debian镜像构build​​,启动和安装依赖关系(例如Docker本身)将使用启动脚本(例如, gcloud compute instances create some-instance –metadata-from-file startup-script=/path/to/startup.sh )。 如果我手动创build一个虚拟机,用sudo -s提升,运行gsutil config -f (在/root/.boto创build一个凭证文件),然后运行我的docker容器(见下面的Dockerfile) docker run -v /root/.boto:/root/.boto username/gs gsutil ls gs://my-test-bucket 那么它的工作。 但是,这需要我的交互来创buildboto文件。 我的问题是 :如何将默认服务凭证传递到将在新VM中启动的Docker容器? gsutil即使在“全新的”Debian虚拟机上也能使用,因为它使用所有虚拟机加载的默认计算引擎凭证。 有没有办法使用这些凭据,并将它们传递到docker集装箱? 在第一次调用gsutil到一个新的VM之后,我注意到它创build了〜/ .gsutil和〜/ .config文件夹。 不幸的是,在Docker中安装这两个 docker run -v ~/.config/:/root/.config -v ~/.gsutil:/root/.gsutil username/gs gsutil ls gs://my-test-bucket 不解决我的问题。 它告诉我: ServiceException: […]

Docker中的Elasticsearch 2.0.0群集禅宗发现

我试图以docker方式在google计算引擎的两个不同节点上运行elasticsearch集群。 使用1.7.1,单播工作,但2.0.0,它没有工作,2个节点不能连接在一起 。 下面是Dockerfile , run command和Dockerfile 。 谢谢 Dockerfile FROM java:8 #ENV ES_PKG_NAME elasticsearch-2.0.0 ENV ES_PKG_NAME elasticsearch-1.7.1 RUN \ cd / && \ #wget https://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/2.0.0/$ES_PKG_NAME.tar.gz && \ wget https://download.elasticsearch.org/elasticsearch/elasticsearch/$ES_PKG_NAME.tar.gz && \ tar xvzf $ES_PKG_NAME.tar.gz && \ rm -f $ES_PKG_NAME.tar.gz && \ mv /$ES_PKG_NAME /elasticsearch RUN mkdir -p /data/mnt RUN chmod 777 -R /data/mnt RUN […]

从cloud-init启动运行docker不正确地将“docker.io”前缀为映像名称

我正在用一个cloudinit文件启动一个GCE服务器,它调用一个docker镜像。 在启动时,拖动泊坞窗图像失败,但如果我login时运行相同的服务成功。 我希望它在发布时能够工作。 看看服务日志,它似乎是不正确的docker.iodocker拉前缀,所以失败的工作。 有什么我可以做,以防止这个? 在尝试docker pull之前,我是否需要等待或检查其他东西? 这是我的cloud-init文件: #cloud-config users: – name: shinyuser uid: 2000 write_files: – path: /etc/systemd/system/shinyserver.service permissions: 0644 owner: root content: | [Unit] Description=Shiny server [Service] ExecStart=/usr/bin/docker run –name=vdshinyserver -p 80:3838 -v /home/shinyuser/shinyapps/:/srv/shiny-server/ -v /home/shinyuser/srv/shinylog/:/var/log/ rocker/shiny ExecStop=/usr/bin/docker stop vdshinyserver runcmd: – systemctl daemon-reload – systemctl start shinyserver.service 这里是日志: mark@xxxshiny ~ $ sudo […]

由于SSL,无法连接到Docker守护进程

我试图在Google App / Compute Engine上用命令部署托pipe虚拟机(Python): gcloud –verbosity debug preview app deploy ./app.yaml –set-default 在部署过程中创build虚拟机实例,但在出错时退出(这里是最后几行的列表粘贴): DEBUG: Display disabled. Copying certificates for secure access. You may be prompted to create an SSH keypair. DEBUG: Loaded Command Group: ['gcloud', 'compute', 'copy_files'] DEBUG: Detected docker environment variables: DOCKER_HOST=tcp://104.197.50.238:2376, DOCKER_CERT_PATH=../../../../../tmp/tmpPbKmOs, DOCKER_TLS_VERIFY=True INFO: Starting new HTTPS connection (1): 104.197.50.238 DEBUG: Failed […]

在GCE中使用docker机时,“validation证书错误”

当试图在我的机器上在GCE上创builddocker-machine时,出现以下错误: $ docker-machine create –driver google \ –google-project $PROJECT_ID \ –google-zone $GOOGLE_ZONE \ –google-machine-type $GOOGLE_MACHINE_TYPE \ test-docker-machine Running pre-create checks… (test-docker-machine) Check that the project exists (test-docker-machine)) Check if the instance already exists Creating machine… (test-docker-machine) Generating SSH Key (test-docker-machine) Creating host… (test-docker-machine) Opening firewall ports (test-docker-machine) Creating instance (test-docker-machine) Waiting for Instance (test-docker-machine) Uploading […]

计算引擎上的google cloudML的Docker容器 – 安装存储桶的authentication

我一直在使用谷歌的机器学习平台cloudML 。 大图:我试图找出最简洁的方式,让他们的Docker 环境在Google计算实例上运行起来,可以访问cloudML API和存储桶。 从本地开始,我configuration了我的服务帐户 C:\Program Files (x86)\Google\Cloud SDK>gcloud config list Your active configuration is: [service] [compute] region = us-central1 zone = us-central1-a [core] account = 773889352370-compute@developer.gserviceaccount.com disable_usage_reporting = False project = api-project-773889352370 我用谷歌容器图像系列启动一个计算实例 gcloud compute instances create gci –image-family gci-stable –image-project google-containers –scopes 773889352370-compute@developer.gserviceaccount.com="https://www.googleapis.com/auth/cloud-platform" 编辑:需要明确地设置与cloudML沟通的范围。 然后我可以SSH进入该实例(用于debugging) gcloud compute ssh benweinstein2010@gci 在计算实例上,我可以从GCR中提取cloudML docker并运行它 docker […]

gcloud连接到docker守护进程失败

我试图testing新的托pipe虚拟机function,按照本教程 (使用OS X) boot2docker安装没关系。 执行$(boot2docker shellinit)给出以下输出: Writing /Users/guilhermetorres/.boot2docker/certs/boot2docker-vm/ca.pem Writing /Users/guilhermetorres/.boot2docker/certs/boot2docker-vm/cert.pem Writing /Users/guilhermetorres/.boot2docker/certs/boot2docker-vm/key.pem export DOCKER_HOST=tcp://192.168.59.103:2376 export DOCKER_CERT_PATH=/Users/guilhermetorres/.boot2docker/certs/boot2docker-vm export DOCKER_TLS_VERIFY=1 boot2docker status打印running 和boot2docker version打印Boot2Docker-cli version: v1.5.0 虽然当我尝试运行我的应用程序使用gcloud –verbosity debug preview app run 我得到这个错误: ERROR 2015-03-05 00:36:39,816 containers.py:742] Failed to connect to Docker Daemon due to: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581) 你可以看到EVvariables: DEBUG 2015-03-05 00:36:39,800 containers.py:669] Detected […]

如何在没有此错误的情况下运行`gcloud preview app setup-managed-vms`?

当我运行gcloud –verbosity debug preview app setup-managed-vms我得到以下错误我不知道如何解决google.appengine.tools.docker.containers.ImageError: Image with tag localhost:49153/google/appengine-java was not found 我在pastebin上发布了详细的堆栈跟踪 。 我正在运行Google Cloud SDK 0.9.40和docker 1.3.2。 我有一个与0.9.39不同的问题,卸载并重新安装了一切,但v0.9.40似乎还没有做到这一点。 我怎么能通过这个?