Petro Gromovo
Petro Gromovo

Reputation: 2243

Set of errors starting docker

in my Kubuntu 18.04 I installed docker-ce :

# docker -v
Docker version 19.03.2, build 6a30dfc

# docker info
Client:
 Debug Mode: false

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 0
 Server Version: 19.03.2
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 894b81a4b802e4eb2a91d1ce216b8817763c29fb
 runc version: 425e105d5a03fabd737a126ad93d62a9eeede87f
 init version: fec3683
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 4.15.0-20-generic
 Operating System: Ubuntu 18.04.3 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 7.711GiB
 Name: serge-at-hoe
 ID: 4IWA:LRTR:4UJS:FEDE:PCOJ:ZFFB:RLXR:LRPT:7QBI:XGLY:VVIV:TNJQ
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No swap limit support

But next I got error :

$ docker-compose up -d --build
ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.

I searched for a decision and found next decision as, but got error :

$ export DOCKER_HOST=127.0.0.0/8
#:/mnt/_work_sdb8/wwwroot/lar/DockerApps/votes_docker$ docker-compose up -d --build
Traceback (most recent call last):
  File "/usr/bin/docker-compose", line 11, in <module>
    load_entry_point('docker-compose==1.17.1', 'console_scripts', 'docker-compose')()
  File "/usr/lib/python2.7/dist-packages/compose/cli/main.py", line 68, in main
    command()
  File "/usr/lib/python2.7/dist-packages/compose/cli/main.py", line 118, in perform_command
    project = project_from_options('.', options)
  File "/usr/lib/python2.7/dist-packages/compose/cli/command.py", line 37, in project_from_options
    override_dir=options.get('--project-directory'),
  File "/usr/lib/python2.7/dist-packages/compose/cli/command.py", line 99, in get_project
    host=host, environment=environment
  File "/usr/lib/python2.7/dist-packages/compose/cli/command.py", line 71, in get_client
    environment=environment, tls_version=get_tls_version(environment)
  File "/usr/lib/python2.7/dist-packages/compose/cli/docker_client.py", line 95, in docker_client
    return APIClient(**kwargs)
  File "/usr/lib/python2.7/dist-packages/docker/api/client.py", line 109, in __init__
    base_url, IS_WINDOWS_PLATFORM, tls=bool(tls)
  File "/usr/lib/python2.7/dist-packages/docker/utils/utils.py", line 373, in parse_host
    "Bind address needs a port: {0}".format(addr))
docker.errors.DockerException: Bind address needs a port: 127.0.0.0/8

I used port 127.0.0.0/8 as it was mentioned in output of docker info

command. But looks like that not valid option?

I suppose that docker-compose up -d --build command must be run under non root user. Is it so ?

What is the right way ?

Thanks!

Upvotes: 2

Views: 609

Answers (1)

Petro Gromovo
Petro Gromovo

Reputation: 2243

I found that I need to add the user to the docker group :

sudo  usermod -aG docker $USER
sudo  newgrp - docker

last command was to apply my changes without terminal restarting after that I can run :

docker-compose up -d --build

Upvotes: 2

Related Questions