Docker Private Registry: connection refused

  docker, docker-registry

Unable to connect to local docker repo.

Here is the docker compse file:

version: '3'
services:
  registry:
    restart: always
    image: registry:2
    container_name: registry
    ports:
    - "5000:5000"
    environment:
      REGISTRY_AUTH: htpasswd
      REGISTRY_AUTH_HTPASSWD_REALM: Registry Realm
      REGISTRY_AUTH_HTPASSWD_PATH: /home/user/auth/registry.password
      REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /data
    volumes:
      - ./data:/data

I get the following error when I run docker login localhost:5000 :

> Error response from daemon: Get http://localhost:5000/v2/: dial tcp [::1]:5000: connect: connection refused

Note that: /home/user/auth/registry.password file exist

Source: Docker Questions

LEAVE A COMMENT