Google gsutil auth没有提示

bla*_*ops 4 gsutil docker gcloud

我想在Docker容器中使用gsutil.我创建了一个O2Auth服务帐户JSON文件.

如何设置gsutil auth以使用JSON配置文件并在不提示的情况下执行命令?

目前我得到这样的东西:

$ gsutil config -e
It looks like you are trying to run "/.../google-cloud-sdk/bin/bootstrapping/gsutil.py config".
The "config" command is no longer needed with the Cloud SDK.
To authenticate, run: gcloud auth login
Really run this command? (y/N) y
This command will create a boto config file at /.../.boto
containing your credentials, based on your responses to the following questions. 
What is the full path to your private key file? 
Run Code Online (Sandbox Code Playgroud)

我必须使用哪些命令/参数/设置来提示环境?

bla*_*ops 9

执行以下内容解决了此问题:

gcloud auth activate-service-account --key-file=/opt/gcloud/auth.json
Run Code Online (Sandbox Code Playgroud)

整个示例和完成的容器可以在这里找到:blacklabelops/gcloud