Docker unable to start

When I try to do docker run I get this:

docker: Cannot connect to the Docker daemon. Is the docker daemon running on this host?.

So I looked here https://github.com/docker/kitematic/issues/1010 and I tried this:

  • db.createUser is not creating any user in mongodb in docker setup
  • Run dockerised Flask app to heroku with gunicorn
  • How to connect to MySQL running on Docker from the host machine
  • Run Docker container behind proxy?
  • boot2docker access elasticsearch on localhost
  • Suppressing interactive output in Gradle exec tasks
  • docker-machine env default
    

    But I’m getting:

    Error checking TLS connection: exit status 126
    

    So I looked here https://github.com/docker/toolbox/issues/453 and I tried this:

    docker-machine rm default
    

    Now I’m getting:

    Error removing host "default": exit status 126
    

    So what is the issue and how can I solve it?

  • Error on script to clear cache docker container
  • set hostname service docker swarm
  • Editing static resources in Docker with Spring Boot application
  • Jenkins pipeline docker.image call generates a timeout
  • Oauth authentication in Apache SuperSet
  • Ansible docker_container module env file
  • One Solution collect form web for “Docker unable to start”

    This issue could be caused by a few things:

    1. Permissions – your user does not have the correct access rights to talk to the socket. Runner sudo usermod -aG docker YOUR-USER replacing YOUR-USER to the correct value. Note you will need to completely log out and log back in again for the changes to take effect

    2. Your shell env is not set correctly with docker-machine – Each tab you open in terminal needs to connect to the correct machine if you are to use it correctly try running eval $(docker-machine env default) and then running some docker commands to see if that resolves your issues

    3. Try regenerating the TLS certs for the machine and repeating step 2 – I noticed there was a TLS error. Sometimes the certs for connecting to the daemon can become invalid. Regenerate the certs by running docker-machine regenerate-certs default.

    Update me with your progress and I’ll be happy to help troubleshoot further.

    Hope this helps

    Dylan

    Edit

    1. Try creating a fresh docker machine with docker-machine create -d YOUR-PROVIDER YOUR-NAME and seeing if it is a machine specific issue
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.