Tag: google cloud sdk

Cloud SDK命令gsutil config -a

我正在尝试在我的Dockerfile中包含Google存储的凭据,这样我就不必每次在Kubernetes中创build一个新的Pod或另一个模块。 那么有没有办法像这样把这个命令 gsutil config -a (Access Key) (Secret) 而不是运行命令 gsutil config -a 然后手动插入(访问密钥)和(秘密)。 谢谢

将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没有发现与docker:dind +谷歌/云-sdk

在gitlab-ci中运行以下CI脚本时, docker: command not found错误docker: command not found 。 在部署阶段before_script期间发生此错误。 services: – docker:dind stages: – build – test – deploy before_script: – docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY build: stage: build image: docker:latest script: – docker info – docker version – docker build –pull -t $SERVICE_NAME:$CI_COMMIT_REF_NAME . – docker image list – docker tag […]

Google云组件未启用

我试图通过Travis-CI自动构build到谷歌云,但是当我试图运行“gcloud docker any_command”,我得到的消息 ERROR: (gcloud) Invalid choice: 'docker'. Did you mean 'config'? 当我尝试安装与“gcloud组件安装docker”docker“我得到 You cannot perform this action because the component manager has been disabled for this installation. If you would like get the latest version of the Google Cloud SDK, please see our main download page at: https://developers.google.com/cloud/sdk/ ERROR: (gcloud.components.update) The component manager is […]