docker-archive / migrator

Tool to migrate Docker images from Docker Hub or v1 registry to a v2 registry
Apache License 2.0
160 stars 82 forks source link

migrator attempts to login via v2 API on V1_REGISTRY #118

Open jampy opened 6 years ago

jampy commented 6 years ago

On a machine with Debian 9.5 and docker-ce 18.06.1~ce~3-0~debian just installed, I am not able to login the V1 registry. It seems the migrator is accessing the old registry via the v2 protocol...

grafik

So, it's trying to access /v2/.

I'm using the FQDN of the v1 registry, without https://.

The v1 registry is running registry:0.9.1. I can see the request made by the migrator:

registry_1  | 172.17.0.8 - - [17/Sep/2018:09:16:54 +0000] "GET /v2/ HTTP/1.1" 404 233 "-" "docker/18.06.1-ce go/go1.10.3 git-commit/e68fc7a kernel/4.9.0-8-amd64 os/linux arch/amd64 UpstreamClient(Docker-Client/1.6.2)"

The same happens when I try to do docker login (with a up-to-date client), but I guess that's normal as new clients need a v2 registry...

What am I doing wrong?

mbentley commented 6 years ago

Since your v1 is just using http, you need to use the V1_USE_HTTP option. Check the README for instructions on how to use that as it also involves making sure you have a dameon option set.

jampy commented 6 years ago

Both registries are behind a reverse Proxy, so accessing them using HTTPS is correct.

In fact, you can see the migrator request (GET /v2/) hits the registry.

mbentley commented 6 years ago

Ah so I misinterpreted what you meant by:

I'm using the FQDN of the v1 registry, without https://

With you running such a new engine, it looks like you're hitting this: https://docs.docker.com/engine/deprecated/#interacting-with-v1-registries

v1 registry interaction has been deprecated per this comment:

Starting with Docker 17.12, support for V1 registries has been removed, and the --disable-legacy-registry flag can no longer be used, and dockerd will fail to start when set.

To perform the migration, you will want to install an older engine version.