Comments (3)
I haven't tried to do this, so I'm not actually sure.
The extension contains a Gcloud Command Line task. Using that, you can try running gcloud auth config-docker
.
That may not work with the way the extension injects the credentials into every command. If it does not work, I would try running gcloud auth activate-service-account --key-file=tempKeyFile.json
first.
from google-cloud-tfs.
@ILMTitan Thank you very much for your input. I have already try both commands before but without success. I have now retry both from the beginning and here is report with same result as last time:
- Tasks:
auth configure-docker
- Docker Compose Images build
- Docker Compose push
Log:
==============================================================================
Task : Gcloud Command Line
Description : Execute an arbitrary gcloud command.
Version : 0.0.2
Author : Google Cloud Tools
Help : [List of gcloud commands](https://cloud.google.com/sdk/gcloud/reference/).
==============================================================================
9929f287-** exists true
C:\Windows\system32\cmd.exe /D /S /C ""C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin\gcloud.cmd" auth configure-docker --credential-file-override="C:\agent\_work\3\s\tempKeyFile.json""
WARNING: `docker-credential-gcloud` not in system PATH.
gcloud's Docker credential helper can be configured but it will not work until this is corrected.
WARNING: `docker` not in system PATH.
`docker` and `docker-credential-gcloud` need to be in the same PATH in order to work correctly together.
gcloud's Docker credential helper can be configured but it will not work until this is corrected.
gcloud credential helpers already registered correctly.
******************************************************************************
Finishing: Gcloud Command Line
******************************************************************************
....
==============================================================================
Task : Docker Compose
Description : Build, push or run multi-container Docker applications. Task can be used with Docker or Azure Container registry.
Version : 0.4.15
Author : Microsoft Corporation
Help : [More Information](https://go.microsoft.com/fwlink/?linkid=848006)
==============================================================================
"C:\Program Files\Docker\Docker\Resources\bin\docker.exe" push eu.gcr.io/**dev/**.api:latest
ERROR: (gcloud.auth.docker-helper) You do not currently have an active account selected.
Please run:
$ gcloud auth login
to obtain new credentials, or if you have already logged in with a
different account:
$ gcloud config set account ACCOUNT
to select an already authenticated account to use.
The push refers to repository [eu.gcr.io/**/**.api]
a8ab8bff4d74: Preparing
0d0fb6754078: Preparing
55f6c628a3d5: Preparing
fca06706d90a: Preparing
cd7100a72410: Preparing
unauthorized: You don't have the needed permissions to perform this operation, and you may have invalid credentials. To authenticate your request, follow the steps in: https://cloud.google.com/container-registry/docs/advanced-authentication
ERROR: (gcloud.auth.docker-helper) You do not currently have an active account selected.
Please run:
$ gcloud auth login
to obtain new credentials, or if you have already logged in with a
different account:
$ gcloud config set account ACCOUNT
to select an already authenticated account to use.
C:\Program Files\Docker\Docker\Resources\bin\docker.exe failed with return code: 1
- Tasks:
iam service-accounts keys create --iam-account *-compute@*.gserviceaccount.com keytmp.json
auth activate-service-account --key-file=keytmp.json
- Docker Compose Images build
- Docker Compose push
Log:
C:\Windows\system32\cmd.exe /D /S /C ""C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin\gcloud.cmd" iam service-accounts keys create --iam-account **-compute@**.gserviceaccount.com keytmp.json --credential-file-override="C:\agent\_work\3\s\tempKeyFile.json""
created key [*] of type [json] as [keytmp.json] for [*-compute@*.gserviceaccount.com]
C:\Windows\system32\cmd.exe /D /S /C ""C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin\gcloud.cmd" auth activate-service-account --key-file=keytmp.json --credential-file-override="C:\agent\_work\3\s\tempKeyFile.json""
Activated service account credentials for: [*-compute@*.gserviceaccount.com]
--
"C:\Program Files\Docker\Docker\Resources\bin\docker.exe" push eu.gcr.io/*/*.api:latest
ERROR: (gcloud.auth.docker-helper) You do not currently have an active account selected.
Please run:
$ gcloud auth login
to obtain new credentials, or if you have already logged in with a
different account:
$ gcloud config set account ACCOUNT
to select an already authenticated account to use.
The push refers to repository [eu.gcr.io/**/**.api]
a8ab8bff4d74: Preparing
0d0fb6754078: Preparing
55f6c628a3d5: Preparing
fca06706d90a: Preparing
cd7100a72410: Preparing
unauthorized: You don't have the needed permissions to perform this operation, and you may have invalid credentials. To authenticate your request, follow the steps in: https://cloud.google.com/container-registry/docs/advanced-authentication
ERROR: (gcloud.auth.docker-helper) You do not currently have an active account selected.
Please run:
$ gcloud auth login
to obtain new credentials, or if you have already logged in with a
different account:
$ gcloud config set account ACCOUNT
to select an already authenticated account to use.
C:\Program Files\Docker\Docker\Resources\bin\docker.exe failed with return code: 1
What I'm missing?
from google-cloud-tfs.
Hi
I have finally solved the issue. I have just used JSON key file as docker login options.
Here is complete solution for TFS side:
1. Add new Service Endpoint: Docker Registry
- Registry type: Other
- Docker Registry: https://[gcr.io, us.gcr.io, eu.gcr.io, or asia.gcr.io]
- Docker ID: _json_key
- Password: [Copy-Paste content from exported service account JSON key file]
2. Edit your Build Definitions
3. Edit your Docker Compose tasks
- Container Registry Type: Container Registry
- Docker Registry Connection: [Select Docker Registry endpoint that you have add earlier]
I hope that this will help someone with the same problem that I had!
from google-cloud-tfs.
Related Issues (18)
- Task to execute gcloud command line HOT 1
- Task to execute kubectl command line.
- Add image parameter to Deploy to Google App Engine task
- Add new Google Cloud Platform connection fails HOT 2
- Install CloudSDK task is slow. HOT 1
- A failing test does not fail the build.
- Deploy App Engine Copy Yaml should be more flexible.
- Use release version of the GAE deploy tool HOT 1
- Specify verbosity level of custom task HOT 4
- Update Deploy GAE task to require gcloud 174.0.0.
- VSTS Marketplace version has been removed HOT 8
- Linux / MacOS build agents not supported HOT 3
- Visual Studio Marketplace link in README points to a non-existing extension HOT 1
- gcloud container builder task HOT 1
- Google container builder task cannot find gcloud HOT 12
- Marketplace extension not found HOT 3
- IS THIS PROJECT DEAD? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from google-cloud-tfs.