Skip to content
This repository has been archived by the owner on Mar 11, 2020. It is now read-only.

can i migrate from v2 registry to another ? #110

Open
vagharsh opened this issue Aug 24, 2017 · 6 comments
Open

can i migrate from v2 registry to another ? #110

vagharsh opened this issue Aug 24, 2017 · 6 comments

Comments

@vagharsh
Copy link

i have a docker registry:2 private registry which is running for quite sometime in my testing environment with auth ( httpasswd ) and i want to change it's auth method to token based. can i use the migrator to migrate its database ( images, tags, layers everything ? ) or is there another way to do it.

@mbentley
Copy link
Contributor

There actually isn't a database for the image data; it is all based on what exists on disk. If you copy the contents from the old to new registry, all data will just be there.

@smiller171
Copy link

@mbentley This doesn't work cleanly on some storage drivers (I know btrfs fails if you try to just copy) and migration is valuable if you want to move from one storage backend to another.

@mbentley
Copy link
Contributor

mbentley commented Jun 5, 2018

You mean when the registry image data is stored on disk and the disk is formatted with brtfs, it fails to copy over to the new registry? That doesn't make much sense as the registry wouldn't store the files in any different way for a different filesystem, at least not that I am aware of. Are you talking about from one Docker engine to another?

@smiller171
Copy link

smiller171 commented Jun 5, 2018

@mbently I mean I tested creating 2 identical LXC containers with Docker installed using btrfs backend, pulled library/bash to #​1, stopped Docker on #​2, erased /var/lib/docker on #​2, copied /var/lib/docker from #​1 to #​2, started Docker back up, and tried to run docker run -it bash on #​2 resulting in a permission denied error. This doesn't happen with Overlay2.

I think the reason this happens is because with btrfs the layers aren't just files, they are btrfs file system objects of some kind. I don't know enough about btrfs to say any more than that.

@mbentley
Copy link
Contributor

mbentley commented Jun 5, 2018

So yeah, that's the problem. /var/lib/docker is for local engine storage. The Docker v2 registry image storage is completely different.

You would be better off doing a docker save and docker load from one engine to the other:

docker save -o myimages.tar $(docker images --format '{{.Repository}}:{{.Tag}}') > myimages.tar
docker load -i myimages.tar

@smiller171
Copy link

@mbentley Thanks for that clarification.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants