I have Artifactory Pro Docker image version 5.4.5 set up. I am using Nginx as well with HTTPS enabled using self-signed certificate. When I try running docker pull
command, i get error:
[root@tom ~]# docker pull docker-dev.artifactory.company.com/docker/hello-world
Using default tag: latest
Error response from daemon: error unmarshalling content: invalid character '<' looking for beginning of value
docker login
works fine.
[root@tom ~]# docker login docker-dev.artifactory.company.com --username admin --password password
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded
On Artifactory server,
$ cat /data/nginx/logs/access.log
ip = 10.150.16.53 user = "-" local_time = "31/May/2019:16:52:25 +0000" host = docker-dev.artifactory.company.com request = "GET /v2/ HTTP/1.1" status = 302 bytes = 0 upstream = "103.224.212.222:80" upstream_time = 0.548 request_time = 0.548 referer = "-" UA = "docker/18.09.5 go/go1.10.8 git-commit/e8ff056 kernel/3.10.0-693.17.1.el7.x86_64 os/linux arch/amd64 UpstreamClient(Docker-Client/18.09.5 \x5C(linux\x5C))"
ip = 10.150.16.53 user = "-" local_time = "31/May/2019:16:52:27 +0000" host = docker-dev.artifactory.company.com request = "GET /v2/docker/hello-world/manifests/latest HTTP/1.1" status = 302 bytes = 0 upstream = "103.224.212.222:80" upstream_time = 0.521 request_time = 0.521 referer = "-" UA = "docker/18.09.5 go/go1.10.8 git-commit/e8ff056 kernel/3.10.0-693.17.1.el7.x86_64 os/linux arch/amd64 UpstreamClient(Docker-Client/18.09.5 \x5C(linux\x5C))"
Nginx configuration:
$ cat /data/nginx/conf.d/artifactory.conf
###########################################################
## this configuration was generated by JFrog Artifactory ##
###########################################################
## add ssl entries when https has been set in config
ssl_certificate /var/opt/jfrog/nginx/ssl/example.pem;
ssl_certificate_key /var/opt/jfrog/nginx/ssl/example.key;
ssl_session_cache shared:SSL:1m;
ssl_prefer_server_ciphers on;
## server configuration
server {
listen 443 ssl;
listen 80 ;
server_name ~(?<repo>.+)\.artifactory.company.com artifactory.company.com;
if ($http_x_forwarded_proto = '') {
set $http_x_forwarded_proto $scheme;
}
## Application specific logs
## access_log /var/log/nginx/artifactory.company.com-access.log timing;
## error_log /var/log/nginx/artifactory.company.com-error.log;
rewrite ^/$ /artifactory/webapp/ redirect;
rewrite ^/artifactory/?(/webapp)?$ /artifactory/webapp/ redirect;
rewrite ^/(v1|v2)/(.*) /artifactory/api/docker/$repo/$1/$2;
chunked_transfer_encoding on;
client_max_body_size 0;
location /artifactory/ {
proxy_read_timeout 900;
proxy_pass_header Server;
proxy_cookie_path ~*^/.* /;
if ( $request_uri ~ ^/artifactory/(.*)$ ) {
proxy_pass http://artifactory.company.com:80/artifactory/$1;
}
proxy_pass http://artifactory.company.com:80/artifactory/;
proxy_set_header X-Artifactory-Override-Base-Url $http_x_forwarded_proto://$host:$server_port/artifactory;
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;
}
}
I did check the official guide and few other online articles but couldn't get it working since last two days. Will really appreciate some help.