Skip to content

Get secret from docker-credential-gcloud cli

Why

Not sure, perhaps you want to see what the Secret comes out as

How

The command line docker-credential-gcloud CLI has 3 methods, from what I can tell

  • GET
  • LIST
  • DELETE

For all of these except list, you need to pass the URL of the server as standard input.

Get

echo "europe-west2-docker.pkg.dev" | docker-credential-gcloud get

Example output

{
  "Secret": "ya29.<gcloud token>",
  "Username": "_dcgcloud_token"
}

List

docker-credential-gcloud list

Example output

{
  "https://asia.gcr.io": "_dcgcloud_token",
  "https://eu.gcr.io": "_dcgcloud_token",
  "https://gcr.io": "_dcgcloud_token",
  "https://marketplace.gcr.io": "_dcgcloud_token",
  "https://staging-k8s.gcr.io": "_dcgcloud_token",
  "https://us.gcr.io": "_dcgcloud_token"
}

Delete

Not entirely sure that this actually deletes the credentials

docker-credential-gcloud delete

Want to make this site better? Open a PR or help fund hosting costs