gcloud init kann in dockerfile nicht ausgeführt werden

Ich habe ein Dockerfile für die Bereitstellung meiner node.js-Anwendung in der Google Container Engine erstellt. Es sieht so aus:

FROM node:0.12
COPY google-cloud-sdk /google-cloud-sdk
RUN /google-cloud-sdk/bin/gcloud init
COPY bpe /bpe
CMD cd /bpe;npm start

Ich sollte gcloud init in Dockerfile verwenden, da meine node.js-Anwendung das gcloud-node-Modul zum Erstellen von Buckets in GCS verwendet. Wenn ich die obige Docker-Datei verwende und das Docker-Build durchführe, schlägt sie mit den folgenden Fehlern feh

sudo docker build -t gcr.io/[PROJECT_ID]/test-node:v1 .

Sending build context to Docker daemon 489.3 MB
Sending build context to Docker daemon 
Step 0 : FROM node:0.12
 ---> 57ef47f6c658
Step 1 : COPY google-cloud-sdk /google-cloud-sdk
 ---> f102b82812f5
Removing intermediate container 4433b0f3627f
Step 2 : RUN /google-cloud-sdk/bin/gcloud init
 ---> Running in 21aead97cf65
Welcome! This command will take you through the configuration of gcloud.

Your current configuration has been set to: [default]

To continue, you must log in. Would you like to log in (Y/n)?  
Go to the following link in your browser:

    https://accounts.google.com/o/oauth2/auth?redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&prompt=select_account&response_type=code&client_id=32555940559.apps.googleusercontent.com&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fappengine.admin+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcompute&access_type=offline


ERROR: There was a problem with web authentication.
ERROR: (gcloud.auth.login) invalid_grant
ERROR: (gcloud.init) Failed command: [auth login --force --brief] with exit code [1]

Ich habe es geschafft, indem ich den Authentifizierungsschlüssel im Quellcode von Google-Cloud-SDK fest codiert habe.Bitte teilen Sie mir den richtigen Weg zur Lösung dieses Problems mit.

Antworten auf die Frage(4)

Ihre Antwort auf die Frage