Need help troubleshooting Nexus 3 Docker configuration

1,443 views
Skip to first unread message

RJ Militante

unread,
Sep 3, 2016, 10:47:18 PM9/3/16
to Nexus Users
I’m going through the video walkthrough on setting up Nexus 3 Docker repositories.  I have configured my Nexus 3 software to serve content via https on port 18079.  And I have set up 3 Docker repositories:

Docker proxy repository
Name: docker-hub
Format: docker
Type: proxy 
Online: X
Repository connectors: none
Docker Registry API Support
Enable Docker V1 API: X
Remote storage:
Docker Index: Use docker hub
Auto blocking enabled 
Auto block outbound connections: X
Maximum component age: 1440
Maximum metadata age: 1440
Storage: default
Strict content type validation: X
Negative cache not found cache enabled: X

Docker hosted repository
Name: docker-internal
Format: docker
Type: hosted
Online: X
Repository connectors
HTTPS: 18078
Docker Registry API Support
Enable Docker V1 API: X
Storage 
Blog store: default
Strict content type validation: X
Hosted
Deployment policy: allow redeploy

Docker repository group
Name: docker-all
Format: docker
Type: group
Online: X
Repository connectors
HTTPS: 18077
Docker Registry API Support
Enable Docker V1 API: X
Storage 
Blog store: default
Strict content type validation: X
Group
Member repositories: docker-hub, docker-internal

There is a problem with my configuration.  When I try to perform a docker search operation I either get a 404 or a connection refused. 

jenkins@d9262dcfc466:/$ sudo docker search 192.168.99.100:18077/test
Error response from daemon: invalid registry endpoint "http://192.168.99.100:18077/v1/". HTTPS attempt: Get https://192.168.99.100:18077/v1/_ping: dial tcp 192.168.99.100:18077: getsockopt: connection refused. HTTP attempt: Get http://192.168.99.100:18077/v1/_ping: dial tcp 192.168.99.100:18077: getsockopt: connection refused
jenkins@d9262dcfc466
:/$ sudo docker search 192.168.99.100:18078/test
Error response from daemon: invalid registry endpoint "http://192.168.99.100:18078/v1/". HTTPS attempt: Get https://192.168.99.100:18078/v1/_ping: dial tcp 192.168.99.100:18078: getsockopt: connection refused. HTTP attempt: Get http://192.168.99.100:18078/v1/_ping: dial tcp 192.168.99.100:18078: getsockopt: connection refused
jenkins@d9262dcfc466
:/$ sudo docker search 192.168.99.100:18079/test
Error response from daemon: Unexpected status code 404



I guess my first question is - which port should I be querying the repositories from?  the docker group port (18077), the docker internal port (18078), or the https port that Nexus is configured to run on (18079)?  I think 18079, but not sure.  Also I’m sort of at a loss right now about where to go next in troubleshooting this.  

I notice Nexus 3 is auto configuring URL for these Docker repositories with using my non SSL port 18081 (e.g., http://192.168.99.100:18081/repository/docker-hub/) - should it be auto configuring URL with https lilke
https://192.168.99.100:18079/repository/docker-hub/ ?  Not sure if this is a problem.

Any advice on this would be appreciated.

Thanks,
RJ 

morten bjoernsvik

unread,
Oct 4, 2016, 2:54:39 AM10/4/16
to Nexus Users
AFAIK docker search is a dockerhub feature not a docker registry feature:
https://docs.docker.com/engine/reference/commandline/search/

But You can use curl

# below is a small docker hosted registry
$ curl -X GET https://nexus3.intra.buypass.no:5001/v2/_catalog
{"repositories":["alpine","node"]}
$ curl -X GET https://nexus3.intra.buypass.no:5001/v2/node/tags/list
{"name":"node","tags":["v6.4.0"]}

$ docker search nexus3.intra.buypass.no:5001
NAME      DESCRIPTION   STARS     OFFICIAL   AUTOMATED


--
MortenB

Jose San Leandro

unread,
Oct 4, 2016, 4:36:42 AM10/4/16
to morten bjoernsvik, Nexus Users
Hi,

The "connection refused" issue probably has to do with the SSL configuration.
I have a docker image that runs Nexus 3 suitable of being used as Docker registry. It works fine, should you want to take a look. Keep in mind it's highly opinionated, based on Phusion, but you could get the parts you might be missing.

The image is under the nexus folder in http://github.com/rydnr/set-square-phusion-images
The configuration is managed by the bash script https://github.com/rydnr/set-square-phusion-images/blob/master/nexus/50_update_nexus_ssl_config.sh#L239. The "main" function describes the required steps. You'll need to create the SSL certificate beforehand.

I described the instructions to set up Nexus in the image README file, which gets generated after processing https://github.com/rydnr/set-square-phusion-images/blob/master/nexus/README.template

Hope it helps.

Kind regards.
Jose San Leandro.

--
You received this message because you are subscribed to the Google Groups "Nexus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users+unsubscribe@glists.sonatype.com.
To post to this group, send email to nexus...@glists.sonatype.com.
To view this discussion on the web visit https://groups.google.com/a/glists.sonatype.com/d/msgid/nexus-users/5cd0b2f9-2f34-496d-81ec-2c0fffe3def3%40glists.sonatype.com.

Reply all
Reply to author
Forward
0 new messages