Reputation: 6787
I need to perform the following from a python program:
docker pull foo/bar:tag
docker tag foo/bar:tag gcr.io/project_id/mirror/foo/bar:tag
gcloud auth configure-docker --quiet
docker push gcr.io/project_id/mirror/foo/bar:tag
I want to accomplish this with the minimal possible footprint - no root, no privileged Docker installation, etc. The Google Cloud SDK is installed.
How to programmatically mirror the image with minimal app footprint?
Upvotes: 0
Views: 549
Reputation: 70
Google cloud build API can be used to perform all your required steps in one command Or use Trigger.
Above command, you can call using Python cloud Build API https://googleapis.dev/python/cloudbuild/latest/gapic/v1/api.html
Upvotes: 2