Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing docker-compose killed docker #6099

Closed
gregfr opened this issue Jul 20, 2018 · 12 comments
Closed

Installing docker-compose killed docker #6099

gregfr opened this issue Jul 20, 2018 · 12 comments

Comments

@gregfr
Copy link

gregfr commented Jul 20, 2018

Description of the issue

I've installed a fresh Ubuntu 18.04, then docker from repos, then a few containers. Everything was doing fine.
I've then installed docker-composer from repos : docker is now dead, I can't start it, even after rebooting.

Context information (for bug reports)

Output of "docker-compose version"

docker-compose version 1.17.1, build unknown
docker-py version: 2.5.1
CPython version: 2.7.15rc1
OpenSSL version: OpenSSL 1.1.0g  2 Nov 2017

Output of "docker version"

Client:
 Version:       17.12.1-ce
 API version:   1.35
 Go version:    go1.10.1
 Git commit:    7390fc6
 Built: Wed Apr 18 01:23:11 2018
 OS/Arch:       linux/amd64
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

Output of "docker-compose config"

ERROR: 
        Can't find a suitable configuration file in this directory or any
        parent. Are you in the right directory?

        Supported filenames: docker-compose.yml, docker-compose.yaml
# service docker start
Job for docker.socket failed.
See "systemctl status docker.socket" and "journalctl -xe" for details.
Failed to start docker.service: Unit docker.service is masked.
# systemctl status docker.socket
● docker.socket - Docker Socket for the API
   Loaded: loaded (/lib/systemd/system/docker.socket; enabled; vendor preset: enabled)
   Active: inactive (dead)
   Listen: /var/run/docker.sock (Stream)

Jul 20 17:38:33 ros systemd[1]: docker.socket: Socket service docker.service not loaded, refusing.
Jul 20 17:38:33 ros systemd[1]: Failed to listen on Docker Socket for the API.
Jul 20 21:05:53 ros systemd[1]: docker.socket: Socket service docker.service not loaded, refusing.
Jul 20 21:05:53 ros systemd[1]: Failed to listen on Docker Socket for the API.
Jul 20 21:16:08 ros systemd[1]: docker.socket: Socket service docker.service not loaded, refusing.
Jul 20 21:16:08 ros systemd[1]: Failed to listen on Docker Socket for the API.

Everything was done as root, so I don't think it's a permission problem.
I've done some googling but didn't find any solution.

Is there a way to get thing back online without re-installing everything?

Thanks

@gregfr
Copy link
Author

gregfr commented Jul 20, 2018

I removed completely docker and docker-compose, and re-installed only docker, still dead.

@thaJeztah
Copy link
Member

Did you install docker-compose from the Ubuntu repository? (ie, a version that's packaged by Ubuntu?)

I wonder if doing so also resulted in the Ubuntu packaged version of Docker to be installed (given that that would be a conflicting package, possibly that resulted in your existing version of Docker to be uninstalled)

@shin-
Copy link

shin- commented Jul 31, 2018

Closing, but please update if you're still seeing issues. As @thaJeztah pointed out, distro packages can cause some problems - refer to our documentation for the supported install options: https://docs.docker.com/compose/install/

@shin- shin- closed this as completed Jul 31, 2018
@whysthatso
Copy link

fwiw i just ran into this:

  • first installed docker.io on ubuntu 16.04
  • used it long time with systemd enabled service for the daemon, no problems
  • upgraded to 18.04
  • continued using with no problems
  • now wanted to add docker-compose
  • see problem above

My theory atm:
docker-compose possibly maskes the docker.io systemd unit file (links it to /dev/null), purging docker.io and docker-compose does not remove this link. after reinstalling docker-compose, problem persists.

Solution:
once i did 'rm /etc/systemd/system/docker.service' i could manage the service via 'systemctl'

i'm not sure how this happens, it might be related to the still existing SysV init-files for the package, and how they get handled in conjunction with 18.04 and possibly 16.04

it's all pretty weird.

@scriptburn
Copy link

same thing with me too ,installed docker-compose and docker daemon wont start

@Nixellion
Copy link

@whysthatso Just ran into this issue, could you please describe the full solution step by step? Do I need to uninstall docker-compose and stuff and then reinstall docker or what?

@whysthatso
Copy link

@whysthatso Just ran into this issue, could you please describe the full solution step by step? Do I need to uninstall docker-compose and stuff and then reinstall docker or what?

as far as i remember:

  • uninstall everything docker-related
  • check if there is /etc/systemd/system/docker.service, delete it
  • install docker-compose

or it could be:

  • uninstall everything docker-related

but yeah, sorry, i realized i should have contextualized my comment a bit better

  • install docker-compose
  • check if there is /etc/systemd/system/docker.service, delete it

try both, can't really mess anything up here

@Nixellion
Copy link

@whysthatso Thanks, I actually solved it. The main point is to make sure to isntall Docker CE and Compose from appropriate repositories, not from distro's repos

@dennisallard
Copy link

dennisallard commented Aug 26, 2019

I have same problem. Installing docker-compose killed running docker daemon. How sad there is no standard repo for Ubuntu for both docker and docker-compose. I found the following link that explains the two alternative universes for docker on Debian (docker.io vs docker-ce):

https://www.collabora.com/news-and-blog/blog/2018/07/04/docker-io-debian-package-back-to-life/

I lean toward installing docker-ce as opposed to docker.io, hence follow these two guides:

https://docs.docker.com/install/linux/docker-ce/ubuntu/ (includes uninstall docker.io package)

https://docs.docker.com/compose/install/

@BKDaugherty
Copy link

Oooooof I just ran into this too. Tough that installing docker-compose didn't warn me that it might wreck my day lol, but maybe I shouldn't be blindly running commands in my terminal 🙃

@tigerblue77
Copy link

tigerblue77 commented Feb 5, 2023

Yes, problem still present, service restarting too quickly :

● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2023-02-05 17:59:35 CET; 3min 10s ago
TriggeredBy: ● docker.socket
Docs: https://docs.docker.com
Process: 337516 ExecStart=/usr/sbin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock $DOCKER_OPTS (code=exited, status=1/FAILURE)
Main PID: 337516 (code=exited, status=1/FAILURE)
CPU: 237ms

févr. 05 17:59:35 Jarvis systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
févr. 05 17:59:35 Jarvis systemd[1]: Stopped Docker Application Container Engine.
févr. 05 17:59:35 Jarvis systemd[1]: docker.service: Start request repeated too quickly.
févr. 05 17:59:35 Jarvis systemd[1]: docker.service: Failed with result 'exit-code'.
févr. 05 17:59:35 Jarvis systemd[1]: Failed to start Docker Application Container Engine.

@gasparian
Copy link

Remove docker-compose:

sudo apt --purge remove docker-compose

Check the docker engine again - it should work (restart if needed):

sudo systemctl status docker

Add docker repository and install docker-compose-plugin, by following these steps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants