Compose: ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?

Created on 1 Apr 2020  ·  1Comment  ·  Source: docker/compose

I tried anything in that issue.

witty@witty:~/Desktop/sites/code/finance-api$ sudo docker-compose build
ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?

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

Some information:

sudo docker info

witty@witty:~/Desktop/sites/code/finance-api$ sudo docker info
Client:
 Debug Mode: false

Server:
ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
errors pretty printing info

sudo systemctl status docker

witty@witty:~/Desktop/sites/code/finance-api$ sudo systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2020-04-01 21:21:07 MSK; 12min ago
     Docs: https://docs.docker.com
  Process: 9611 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=e
 Main PID: 9611 (code=exited, status=1/FAILURE)

апр 01 21:21:07 witty systemd[1]: docker.service: Service hold-off time over, scheduling restart.
апр 01 21:21:07 witty systemd[1]: docker.service: Scheduled restart job, restart counter is at 4.
апр 01 21:21:07 witty systemd[1]: Stopped Docker Application Container Engine.
апр 01 21:21:07 witty systemd[1]: docker.service: Start request repeated too quickly.
апр 01 21:21:07 witty systemd[1]: docker.service: Failed with result 'exit-code'.
апр 01 21:21:07 witty systemd[1]: Failed to start Docker Application Container Engine.

journalctl -xe

witty@witty:~/Desktop/sites/code/finance-api$ journalctl -xe
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Automatic restarting of the unit docker.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
апр 01 21:34:55 witty systemd[1]: Stopped Docker Application Container Engine.
-- Subject: Unit docker.service has finished shutting down
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit docker.service has finished shutting down.
апр 01 21:34:55 witty systemd[1]: Closed Docker Socket for the API.
-- Subject: Unit docker.socket has finished shutting down
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit docker.socket has finished shutting down.
апр 01 21:34:55 witty systemd[1]: Stopping Docker Socket for the API.
-- Subject: Unit docker.socket has begun shutting down
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit docker.socket has begun shutting down.
апр 01 21:34:55 witty systemd[1]: Starting Docker Socket for the API.
-- Subject: Unit docker.socket has begun start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit docker.socket has begun starting up.
апр 01 21:34:55 witty systemd[1]: Listening on Docker Socket for the API.
-- Subject: Unit docker.socket has finished start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit docker.socket has finished starting up.
-- 
-- The start-up result is RESULT.
апр 01 21:34:55 witty systemd[1]: Starting Docker Application Container Engine...
-- Subject: Unit docker.service has begun start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit docker.service has begun starting up.
апр 01 21:34:55 witty dockerd[15595]: time="2020-04-01T21:34:55.710906986+03:00" level=info msg="Startin
апр 01 21:34:55 witty dockerd[15595]: failed to start daemon: pid file found, ensure docker is not runni
апр 01 21:34:55 witty systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
апр 01 21:34:55 witty systemd[1]: docker.service: Failed with result 'exit-code'.
апр 01 21:34:55 witty systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit docker.service has failed.
-- 
-- The result is RESULT.

Specs:

  • OS: Ubuntu 18.04 bionic.
  • Docker version: 19.03.8, build afacb8b7f0.

- Docker-compose version: version 1.25.4, build 8d51620a.

Thank you!

kinbug

Most helpful comment

Hi, @WIttyJudge try sudo usermod -aG docker your-user. It works for me.
See docker

>All comments

Hi, @WIttyJudge try sudo usermod -aG docker your-user. It works for me.
See docker

Was this page helpful?
0 / 5 - 0 ratings