Ad

Can Not Connect To Private Nexus Registry

- 1 answer

I'm using docker-desktop (version: Docker version 20.10.12, build e91ed57) on macOS

My problem: Can not connect and push image to the nexus registry container

Here is my steps & errors:

  1. Pull & Start nexus container

    docker volume create --name nexus-data

    docker run -d -p 8081:8081 --name nexus -v nexus-data:/nexus-dasonatype/nexus3:3.37.3

  2. Connect to the 0.0.0.0:8081

Then i connect to the 0.0.0.0:8081 and create a docker-hosted repository and in HTTP section i add the 8083 port.

then i create a user (ali) and assigned to it a password and a role

  1. add insecure-registries to the docker engine

then according to this documentation i added this line to the docker engine:

"insecure-registries": ["0.0.0.0:8083"]
  1. restart the docker and container
  2. try to login

then i tried to login via this command:

docker login 0.0.0.0:8083

but it return an error:

Error response from daemon: Get "http://0.0.0.0:8083/v2/": dial tcp 0.0.0.0:8083: connect: connection refused

Why i get this error?!

i tried many things to solve my problem including:

but nothing works at all!

what should i do?!

Ad

Answer

To access a port in the container from the host, it needs to be published. So the run command should be

docker run -d -p 8081:8081 -p 8083:8083 --name nexus -v nexus-data:/nexus-dasonatype/nexus3:3.37.3
Ad
source: stackoverflow.com
Ad