GithubHelp home page GithubHelp logo

ops-registry-migration's Introduction

OPS python script - Registry Migration (v2 to v2)

This is a python script (python v3.8) that will migrate a registry to another registry (today only v2 to v2).

Comands to launch

git clone https://github.com/motoreagattoimburrato/ops-registry-migration.git
cd ops-registry-migration
# change vars -> see paragraphs below
chmod a+x main.py
python3 main.py

Requirements

Before start, you need to install these python(3) modules:

docker==5.0.2
requests==2.26.0
jsonref==0.2
jsonschema==3.2.0
simplejson==3.16.0

You can do it using the following comand:

pip3 install --requirement ./requirements.txt

Before the run

Before run main.py, change the following variables with those most appropriate for you case.

### Configuration vars
# old registry name
old_registry = "localhost:5001"
# new registry name
new_registry = "localhost:5002"
# username old registry (optional)
#old_user = "changeme"
# password old registry (optional)
#old_passwd = "changeme"
# username new registry (optional)
#new_user = "changeme"
# password new registry (optional)
#new_passwd = "changeme"

Testing the script

I made a bash script that can create two type v2 docker registry to test this script (needs SuperUser).

chmod a+x ./scripts/create_registry_v2.sh ; ./scripts/create_registry_v2.sh

To Do list

  • check if docker official registry (is necessary email in login) -> client.login(username=user, password=passwd, email=EMAIL, registry='https://index.docker.io/v1/')
  • check if registry is v1 type and create functions
  • improve logging
  • check and use if registry images needs token/tls_cert/credentials (GET)
  • create CI and QA check

ops-registry-migration's People

Contributors

motoreagattoimburrato avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.