Badr
Badr

Reputation: 733

How to migrate Gitlab Docker Registry to another docker registry?

I am trying to migrate from gitlab-ce to gitlab.com. This includes Docker registry as well. What I need to migrate Gitlab Docker Registry to hosted Docker registry (Nexus3). This might be manually done I imagine, but is there any more efficient way to do it?

Upvotes: 1

Views: 839

Answers (1)

Qasim Sarfraz
Qasim Sarfraz

Reputation: 6442

Normally I used the following workflow for each tag:

docker pull SRC_REGISTRY_HOST/<REPOSITORY:TAG
docker tag SRC_REGISTRY_HOST/<REPOSITORY:TAG DEST_REGISTRY_HOST/<REPOSITORY:TAG
docker push DEST_REGISTRY_HOST/<REPOSITORY:TAG

But I couldn't find it clean so I wrote a small tool to automate all the steps and just use the following:

docker run --rm -it smqasims/imagesync --src SRC_REGISTRY_HOST/<REPOSITORY> --dest DEST_REGISTRY_HOST/<REPOSITORY

This will sync both the repositories and is faster/manageable compared to the other workflow.

Upvotes: 1

Related Questions