NotGlop / docker-drag

Download image from the Docker Hub HTTPS API
GNU General Public License v3.0
675 stars 191 forks source link

Fails when downloading Windows images #5

Closed jcorvino closed 4 years ago

jcorvino commented 4 years ago

This program fails when downloading Windows server core images. For example, python docker_pull.py mcr.microsoft.com/windows/nanoserver will fail.

I believe the issue lies in the fact that microsoft uses https://mcr.microsoft.com/v2/ as it's base API url. I made a work around by setting repo = 'windows' in docker_pull.py and using the microsoft.com link as the base API url which seems to be working for now. Authentication still goes through https://auth.docker.io and works the same way you wrote it.

NotGlop commented 4 years ago

You are right, since you prefix the pull command with mcr.microsoft.com, this means that you will download the image from this specific registry.
Currently the script doesn't support this registry prefix (although you can do it manually like you pointed out). Actually, you do not require an authentication to access Microsoft registry (that's also why it is working).

I will add the support for this.
Thanks for the issue.

jcorvino commented 4 years ago

I forked the project and added basic support for Windows containers along with a few other modifications. Created a pull request for this.

NotGlop commented 4 years ago

Thanks for the PR, i'll review it.
Actually yesterday I added support for custom registries, I just pushed it to have something working right now (but not all particular cases are handled).

Feel free to test all your cases.