google-container-registry

How can I determine if a specific tag is available for an image

余生颓废 提交于 2019-12-12 03:28:49
问题 I'm currently using this to check if an image is available on gcr.io. tags_json=$(curl "https://gcr.io/v2/${repo}/${image}/tags/list" 2>/dev/null) tags_found="$(echo "${tags_json}" | jq ".tags | indices([\"${version}\"]) | any")" This is unfortunate because the version of jq that supports indices is rather new compared to some LTS distros out there... I can get away with this for docker.io, which works with older versions of jq : tags_json=$(curl "https://registry.hub.docker.com/v2

List GCR private registry images

こ雲淡風輕ζ 提交于 2019-12-12 02:59:16
问题 I need to list the images that are stored in each registry. I have the user auth details , but I don't have the registry names . I need to list all the registries and the images located in each registry . Can I able to do it via Google Storage APIs ? I tried via Docker v2 APIs . Docker search is the only possible way, but I need to know the respective registry name for searching. I don't have those details. So I need another possible way to do it. Also i need to list the tags in each repo.

Submit jobs using API Client Library for Python?

夙愿已清 提交于 2019-12-12 02:43:27
问题 Does API Client Library for Python support creation and deletion of pods and jobs on google container engine? 回答1: Given that Kubernetes comes with a Swagger spec (1.2, not the latest version), you can use swagger-codegen to generate an Python API client for it. Here is an example to generate Python API client using https://generator.swagger.io: curl -X POST -H "content-type:application/json" -d '{"swaggerUrl":"https://raw.githubusercontent.com/kubernetes/kubernetes/master/api/swagger-spec/v1

Jenkins Pipeline gcloud problems in docker

我的梦境 提交于 2019-12-11 16:57:35
问题 I'm trying to set up jenkins pipeline according to this article but instead use google container registry to push the docker images to. The Problem: The part which fails me is this jenkinsfile stage block stage ('Push Docker Image To Container Registry') { docker.image('google/cloud-sdk:alpine').inside { sh "echo ${env.GOOGLE_AUTH} > gcp-key.json" sh 'gcloud auth activate-service-account --key-file ./service-account-creds.json' } } The Error: Please verify that you have permissions to write

How to obtain a GCP Bearer token programatically

限于喜欢 提交于 2019-12-11 15:28:17
问题 gcloud auth print-access-token gives me a Bearer token i can use later on. The token looks like: Authorization: Bearer ya29.AHES6ZRVmB7fkLtd1XTmq6mo0S1wqZZi3-Lh_s-6Uw7p8vtgSwg How can i obtain such a token without the use of gcloud, preferably through some python code. #!/usr/bin/python from oauth2client.client import GoogleCredentials credentials = GoogleCredentials.get_application_default() credentials.get_access_token() token1 = credentials.access_token # magic piece of code to convert

Does Google container registry support docker remote API V2

血红的双手。 提交于 2019-12-11 14:08:12
问题 I'm storing my docker images in my private Google Container Registry and I want to interact with the images through registry V2 APIs, such as getting tags of an image ( /v2/:imageName/tags/list ). I believe that it is supported, according to this link But I cannot found related documentation. Can anyone help me? 回答1: Indeed it is (including that endpoint). You should be able to interact with it after authenticating in the standard way outlined here. Feel free to reach out on gcr-contact

gcloud ping attempt failure with performing a 'docker push'

你。 提交于 2019-12-11 02:34:46
问题 I ran the following command gcloud preview docker push gcr.io/project-name/an-image And I got the following error. Does anyone know how I fix that or what it means? All I was doing was following the standard examples just to learn how it works... Thanks :) FATA[0010] Error: v1 ping attempt failed with error: Get https://gcr.io/v1/_ping: dial tcp: i/o timeout. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add --insecure-registry gcr.io to the

How can I find out how much space is used by my container images from the Google Container Registry

…衆ロ難τιáo~ 提交于 2019-12-10 17:04:42
问题 I have pushed container images using gcloud docker push to the Google Container Registry. Two questions: How do I see how much space all my images use? (I can see individual images but I want a total in order not to navigate to all and make a sum) 回答1: Good questions! All your Docker images are stored in a Google Cloud Storage bucket called artifacts.<PROJECT-ID>.appspot.com (Replace <PROJECT-ID> with your project's ID) To find the total space, run gsutil du gs://artifacts.<PROJECT-ID>

How to list the published container images in the Google Container Registry using gcloud or another CLI

落花浮王杯 提交于 2019-12-10 02:06:35
问题 Is there a gcloud API or other command line interface (CLI) to access the list of published container images in the private Google Container Registry? (That is the container registry inside a Google Cloud Platform project) gcloud container does not seem to help: $ gcloud container Usage: gcloud container [optional flags] <group | command> group may be clusters | operations command may be get-server-config Deploy and manage clusters of machines for running containers. flags: --zone ZONE, -z

How to auto deploy google app engine flexible using Container Registry with Build Trigger

大兔子大兔子 提交于 2019-12-08 08:10:12
问题 I'm using GitHub to keep my projects. Using PHP storm I m pushing my script to GitHub repo. I m using Google App engine flexible environment application. Whenever I push to my GitHub repo. The latest script will auto deploy to Google App Engine Flexible Environment PHP project.So, I Created Build Trigger in GCP Container Registry. Here are My PHP sample projects with Docker file web/index.php <?php Echo 'this is sample project'; ?> App.yaml runtime: php env: flex runtime_config: document_root