4

I am using Artifactory for storing docker images. Artifactory setup is using v1 repository to store images. When working from one of he linux machine i am able to pull and push the images from the Artifactory. But when working on my Windows laptop if I am trying to pull the image from the Artifactory it gives me below error

akash@AKASH-WS01 MINGW64 ~
$ docker pull mydocker.abc.com:5903/ubuntu
Using default tag: latest
Error response from daemon: unknown: Unsupported docker v2 repository request for 'demo-docker'

I am using .dockercfg file for authentication and have information stored to it. "demo-docker" is a user

Why docker pull command is using v2 repository when mydocker.abc.com:5903/ubuntu is on v1.Is there any way to make docker pull to use v1

Dror Bereznitsky
  • 20,048
  • 3
  • 48
  • 57
thinkingmonster
  • 5,063
  • 8
  • 35
  • 57
  • What version of docker are you using. I did not see dockercfg since 1.7 (http://stackoverflow.com/a/35547703/6309) – VonC Feb 23 '16 at 07:33
  • Docker version 1.10.1, build 9e83765 – thinkingmonster Feb 23 '16 at 08:09
  • Then `.dockercfg` is now called `config.json` – VonC Feb 23 '16 at 08:10
  • i tried but no sucess. FYI i am using dockertools and docker is running in windows – thinkingmonster Feb 23 '16 at 08:57
  • 1
    With 1.10+ I don't know if you can use a registry v1. It should be v2 only. – VonC Feb 23 '16 at 09:06
  • How to download docker tools 1.9.On docker site i can only find 1.10.1 version – thinkingmonster Feb 23 '16 at 10:07
  • Whare are you looking? Could you use 1.10? – VonC Feb 23 '16 at 10:11
  • Now i tested on linux machine with docker 1.9 and its working fine.I guess you right that docker 1.10.1 can be reason that its not going to use v1.I am downloading at https://www.docker.com/products/docker-toolbox but it provides docker 1.10.2. – thinkingmonster Feb 23 '16 at 10:32
  • some how i found dockertools 1.9 but after installing same its auto upgrading to docker 1.10.2 i surely unchecked update option Running pre-create checks... (default) Default Boot2Docker ISO is out-of-date, downloading the latest release ... (default) Latest release for github.com/boot2docker/boot2docker is v1.10.2 (default) Downloading C:\Users\akathaku\.docker\machine\cache\boot2docker.iso fr om https://github.com/boot2docker/boot2docker/releases/download/v1.10.2/boot2doc ker.iso... – thinkingmonster Feb 23 '16 at 11:06
  • You can downgrade: https://forums.docker.com/t/is-there-a-way-to-downgrade-boot2docker-iso-for-latest-docker-machine/6171 using `--virtualbox-boot2docker-url` – VonC Feb 23 '16 at 11:18
  • V1 is still supported on 1.10 but that version did make changes in how it's authentication works - what Artifactory version are you using? – danf Feb 25 '16 at 16:25
  • i am using artifactory 1.3 – thinkingmonster Feb 25 '16 at 16:32

1 Answers1

1

I had the same problem, I adjusted my nginx to resolve the issue:

Artifactory Version: 4.15.0 Docker Version: 1.12.0

  1. Stop Nginx service (service nginx stop)
  2. Open your conf file in nginx (/etc/nginx/sites-enabled/default.conf) and change following line in it:

rewrite ^/(v1|v2)/(.*) /api/docker/build-images/$1/$2;

to

rewrite ^/(v2)/(.*) /api/docker/build-images/$1/$2;

Example below:

server {
listen 8000 ssl;server_name artifactory.corpintra.net;
if ($http_x_forwarded_proto = '') {
    set $http_x_forwarded_proto  $scheme;
}
## Application specific logs
access_log /var/log/nginx/build-docker-access.log;
error_log /var/log/nginx/build-docker-error.log;
rewrite ^/(v2)/(.*) /api/docker/build-images/$1/$2;
client_max_body_size 0;
chunked_transfer_encoding on;
location / {
proxy_read_timeout  900;
proxy_pass_header   Server;
proxy_cookie_path ~*^/.* /;
proxy_pass         http://localhost:8081/artifactory/;
proxy_set_header   X-Artifactory-Override-Base-Url $http_x_forwarded_proto://$host:$server_port;
proxy_set_header    X-Forwarded-Port  $server_port;
proxy_set_header    X-Forwarded-Proto $http_x_forwarded_proto;
proxy_set_header    Host              $http_host;
proxy_set_header    X-Forwarded-For   $proxy_add_x_forwarded_for;
}}    
  1. Restart Nginx (service nginx restart)
Siva Mandadi
  • 3,673
  • 2
  • 18
  • 12