dockercentosdocker-composenexus3

docker login into nexus connection refused


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


Solution

  • 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.