artifactory-docker-examples: art-compose and hosting a docker repository not working together.
I have a 3 note setup (by using art-compose) and then hosting a docker repository in the resulting artifactory instance. I can login to the docker repo if I point the docker client directly at artifactory but if I try to use the nginx the authentication doesn’t seem to be making it across and it gives a strange error about v2 docker not supported.
I’m duplicating here but the original question is on slashdot.
- CentOS 7.3
- SELinux Disable
- All activity below is on the “host” machine, just using different IP addresses and ports.
- 10.15.53.21 is the host itself, this is where the art-compose was run.
- 172.19.0.3 is the bridged docker network for the artifactory container. nginx is 172.19.0.4.
We’re running artifactory 6.0.2 6.0.3 on-perm as a container (along with nginx and postgresql) as described in running artifactory as a docker instance.
I have set up the basic “docker” instance.
Locally on the same machine as the artifactory container:
# docker login localhost:8081
Username: test
Password:
Login Succeeded
However, using the nginx port:
# export DOCKER_OPTS=" --insecure-registry docker-local.artifactory.company.com"
# echo password | docker login -u test --password-stdin artifactory.company.com
Error response from daemon: Get https://artifactory.company.com/v2/: unknown: Unsupported docker repository request for 'v2'
I also tried using ~/.docker/config.json with the auth information (base64) however it still giving me the same error.
artifactory.log shows:
2018-06-21 13:25:48,088 [http-nio-8081-exec-3] [ERROR] (o.a.a.d.r.DockerResource:425) - Unsupported docker repository request for 'v2'
access.log shows:
2018-06-21 13:25:48,089 [DENIED LOGIN] for test/172.19.0.4
request.log shows:
20180625075813|1|REQUEST|172.19.0.2|_internal|GET|/api/system/configuration/reverseProxy/nginx|HTTP/1.1|404|0
20180625075823|1|REQUEST|172.19.0.2|_internal|GET|/api/system/configuration/reverseProxy/nginx|HTTP/1.1|404|0
20180625075823|1|REQUEST|10.15.9.4|**non_authenticated_user**|GET|/api/docker//v2/|HTTP/1.0|401|0
20180625075823|2|REQUEST|10.15.9.4|**non_authenticated_user**|GET|/api/docker/v2/token|HTTP/1.0|400|0
nginx access.log:
ip = 10.15.53.21 user = "-" local_time = "27/Jun/2018:11:28:36 +0000" host = artifactory.company.com request = "GET /v2/ HTTP/1.1" status = 401 bytes = 87 upstream = "172.19.0.3:8081" upstream_time = 0.001 request_time = 0.001 referer = "-" UA = "docker/18.03.1-ce go/go1.9.5 git-commit/9ee9f40 kernel/3.10.0-862.3.3.el7.x86_64 os/linux arch/amd64 UpstreamClient(Docker-Client/18.03.1-ce \x5C(linux\x5C))"
ip = 10.15.53.121 user = "test" local_time = "27/Jun/2018:11:28:36 +0000" host = artifactory.company.com request = "GET /artifactory/api/docker//v2/token?account=test&client_id=docker&offline_token=true&service=artifactory.company.com%3A443 HTTP/1.1" status = 400 bytes = 122 upstream = "172.19.0.3:8081" upstream_time = 0.001 request_time = 0.001 referer = "-" UA = "docker/18.03.1-ce go/go1.9.5 git-commit/9ee9f40 kernel/3.10.0-862.3.3.el7.x86_64 os/linux arch/amd64 UpstreamClient(Docker-Client/18.03.1-ce \x5C(linux\x5C))"
About this issue
- Original URL
- State: open
- Created 6 years ago
- Comments: 30 (14 by maintainers)
BTW, I think that I have solved this by amending the server_name part of the nginx configuration to:
server_name ~(?<repo>.+)\.artifactory.company-name.com artifactory.company-name.com ~(?<repo>.+)\-artifactory.company-name.com;