Skip to content

Python script to migrate from a docker registry to google cloud registry

License

Notifications You must be signed in to change notification settings

troii/migr8-registry-gcloud

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

Migrate from private docker registry to gcloud

Description

Written in Python: Running python migrate.py will get a list of all available repositories and version tags from your existing private registry and will push all new repos with images/versions to your Gcloud docker registry

Requirements

Gcloud sdk must be installed and authenticated. Gcloud alpha command group needs to be installed.

You must have a project created with gcloud.

Private registry you are migrating from should have HTTPS enabled.

Four Environment Variables need to be exported

export GCLOUD_URL="gcr.io/<project-name>"
export REG_URL="docker-registry.example.com:5000"
export GCLOUDPATH="/usr/bin/gcloud"
export DOCKERPATH="/usr/bin/docker"

GCloud SDK install

Link to interactive install

Troubleshooting

If you see something like the following: You are missing an exported variable.

Traceback (most recent call last):
  File "./migrate.py", line 122, in <module>
    MigrateToGcloud()
  File "./migrate.py", line 36, in __init__
    self._get_catalog()
  File "./migrate.py", line 40, in _get_catalog
    r = requests.get('https://' + self.REG_URL + 'v2/_catalog')

About

Python script to migrate from a docker registry to google cloud registry

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%