Rails, Docker: Host does not exist: “default”

前端 未结 4 1203
耶瑟儿~
耶瑟儿~ 2021-01-30 08:42

When I try to run docker-machine start default , I get Host does not exist: \"default\", I tried eval \"$(docker-machine env default)\", b

相关标签:
4条回答
  • 2021-01-30 09:11

    you may try:

    docker-machine create -d virtualbox default
    

    UPDATE 2016/10/19

    The old answer may only work on mac with virtualbox installed.

    If you are running docker-machine on windows, you should use Hyper-V :

    docker-machine create --driver hyperv vm
    

    see detail here:https://docs.docker.com/machine/drivers/hyper-v/

    And if you are using Docker Machine to provision hosts on cloud providers, you may need other driver such as amazonec2 . More detail:https://docs.docker.com/machine/get-started-cloud/

    0 讨论(0)
  • 2021-01-30 09:19

    In case you run

    docker-machine ls
    

    and it lists default but running docker-machine kill default and docker-machine stop default both complain that it doesn't exist, try to remove it completely and setup again:

    docker-machine rm default
    docker-machine create default
    

    (had this weird issue on Windows with virtualbox)

    0 讨论(0)
  • 2021-01-30 09:27

    Try simply to check what machine has been created (docker-machine ls):

    docker-machine ls
    

    Then you can pick one and try your commands with it.

    If there is none, you can create one first (docker-machine create).
    In the case of the OP:

    docker-machine create default
    

    Since the error message was:

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

    One of the answers of "Docker command can't connect to docker daemon" should work:

    sudo service docker restart
    
    0 讨论(0)
  • 2021-01-30 09:33

    Sometimes, docker-machine start default might misbehave and require you to rerun the command again. In that case, running eval "$(docker-machine env default)" will bring back joy :)

    0 讨论(0)
提交回复
热议问题