docker login into nexus connection refused

12,633

Solution 1

for http, edit the docker registry, mark the "Create an HTTP connector at specified port. Normally used if the server is behind a secure proxy." set the port to 8083 and it'senter image description here done.

Solution 2

Few days ago I came across this issue myself. If you have a look at the Docker Nexus 3 logs you should see that it cannot allocate the given ports for some reasons (or at least in my case). The way I have fixed this was to have a look at the Nexus documentation and edit jetty-https.xml, nexus.properties and org.sonatype.nexus.cfg as https://support.sonatype.com/hc/en-us/articles/217542177 and https://support.sonatype.com/hc/en-us/articles/231723267-How-to-Upgrade-Nexus-Repository-Manager-3-0-2-to-3-1-0-or-Later

Share:
12,633
xross
Author by

xross

"I destroyed my body for a peace of mind I've never got."

Updated on June 09, 2022

Comments

  • xross
    xross almost 2 years

    I have set up my docker repo, below is the docker-compose.yml file:

    version: '2'
    
    networks:
      prodnetwork:
        driver: bridge
    
    services:
     nexus:
      image: sonatype/nexus3
      volumes:
       - "nexus-data:/nexus-data"
      ports:
       - "8081:8081"
       - "8082:8082"
       - "8083:8083"
       - "8084:8084"
       - "8085:8085"
       - "8086:8086"
       - "8087:8087"
       - "8088:8088"
      networks:
       - prodnetwork
    
     jenkins:
      image: library/jenkins
      ports:
        - "8080:8080"
      networks:
        - prodnetwork
      volumes:
        - /var/run/docker.sock:/var/run/docker.sock
        - /usr/bin/docker:/usr/bin/docker
        - /opt/jenkins/:/var/lib/jenkins/
      depends_on:
        - nexus
        - sonar
      environment:
        - NEXUS_PORT=8081
        - SONAR_PORT=9000
        - SONAR_DB_PORT=5432
    
     sonar:
      build: ./sonar
      ports:
       - "9000:9000"
       - "5432:5432"
      networks:
        - prodnetwork
      depends_on:
        - sonardb
      environment:
       - SONARQUBE_JDBC_URL=jdbc:postgresql://sonardb:5432/sonar
       - SONARQUBE_JDBC_USERNAME=sonar
       - SONARQUBE_JDBC_PASSWORD=sonar
     sonardb:
      networks:
        - prodnetwork
      image: postgres
      environment:
       - POSTGRES_USER=sonar
       - POSTGRES_PASSWORD=sonar
      volumes:
        - /opt/postgres/data:/var/lib/postgresql/data
    
    volumes:
      nexus-data: {}
    

    In the file docker.service I have added:

    DOCKER_OPTS=”$DOCKER_OPTS –insecure-registry=192.168.200.150:8083″
    

    In the nexus 3 I have created repo with http port: 8083 and https: 8123.

    when I am trying to login by command

    docker login -u admin 192.168.200.150:8083 
    

    or 8123 and type in correct password for nexus admin it is written:

    Error response from daemon: Get https://192.168.200.150:8083/v2/: dial tcp 192.168.200.150:8083: getskopt: connection refused.
    

    or

    Error response from daemon: Get https://192.168.200.150:8083/v2/: http: server gave HTTP response to HTTPS client
    

    Do you have an idea how can I do that? I am stuck with it :/ I am using CentOs linux