Docker – Cannot connect to the Docker Daemon to rm containers

Playing with ELK and docker, I needed to restart every services.

docker ps told me that I haven’t any containers up.

  • Is it possible to get host details from within docker container?
  • How to Host Ghost Blog on Home Web Server
  • How to disable the oom killer in linux?
  • Go cannot create RabbitMQ channel. RabbitMQ server on docker container, Go script on host
  • Firefox doesn't wait for a page load Webdriverio
  • Run TFS with Docker
  • docker run -it --rm [...] --name es elasticsearch -> Error response from daemon. The name "es" is already use by container [...]

    So I try to remove all container :

    docker ps -a -q | xargs docker rm -> Cannot connect to the Docker daemon. Is the docker daemon running on this host?

    The container is not up but still here.

    Of course I can simply change my container’s name but it’s not right. That mean I have container running. Even if I restart my server.

    Any idea ?

  • link command hangs when linking container to itself
  • TravisCI/Docker support: iptables: No chain/target/match by that name
  • Is it possible to create image from file on docker host using docker API?
  • Docker daemon unable to find the dockerfile
  • Docker container with Jmeter Jenkins stops after some time
  • How to run Docker on Ubuntu 15.04?
  • 2 Solutions collect form web for “Docker – Cannot connect to the Docker Daemon to rm containers”

    When you stop your container it’s not getting removed by default, unless you’re providing --rm flag. So, it could be so, like you have started and stopped some container with es name before and it’s stopped now. But it’s not possible to create a new container with the existing name, even if the existing one is not running. Try to use a -a flag to show all containers you have as:

    docker ps -a

    If you have some with the name es, just remove it manually with:

    docker rm es

    You also able to provide -f flag, to force removing the es container even if it’s running.

    docker rm es should do the trick. Furthermore, if you want to remove a running container, you can add the -f parameter(docker rm -f ‘container_name’)

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.