Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

docker-machine: no machine name, no "default" exists

I downloaded and installed Docker for Windows 1.12.1 which in turn installed the docker-machine and docker-compose. I did not install "Docker Toolbox" since its a duplicate of what was installed and my system meets the requirements.

Everything seems to work fine except for docker-machine, I'm running through a tutorial and when I run various docker-machine commands like "ip" or "env" I get the following message.

Error: No machine name(s) specified and no "default" machine exists.

So when I do a "docker-machine ls" there is nothing in the list even though I do have a Hyper-V docker machine installed and docker commands work fine.

C:\tmp>docker-machine ls
NAME   ACTIVE   DRIVER   STATE   URL   SWARM   DOCKER   ERRORS
C:\tmp>

Am I missing something here? Did I miss something in the documentation? If so can someone please point me in the right direction to fix this?

Thanks for any help,

Jim

like image 318
Jim Avatar asked Oct 10 '16 20:10

Jim


People also ask

How do I make docker my default computer?

Create a machine. Run the docker-machine create command, pass the appropriate driver to the --driver flag and provide a machine name. If this is your first machine, name it default as shown in the example. If you already have a “default” machine, choose another name for this new machine.

What is a docker machine?

Docker Machine is a tool for provisioning and managing your Dockerized hosts (hosts with Docker Engine on them). Typically, you install Docker Machine on your local system. Docker Machine has its own command line client docker-machine and the Docker Engine client, docker.

How do you remove a docker machine?

To remove one or more Docker containers, use the docker container rm command, followed by the IDs of the containers you want to remove. If you get an error message similar to the one shown below, it means that the container is running. You'll need to stop the container before removing it.


3 Answers

Docker Machine is a tool that lets you install Docker Engine on virtual hosts

Docker machine just like building docker on a Vm, so first you have to create a Vm, in your case:

docker-machine create default
like image 175
Windsooon Avatar answered Oct 12 '22 05:10

Windsooon


You don't need docker-machine to manage the Hyper-V virtual machine. In fact you can't unless you configure it explicitly to do so. If you want to see your IP use the Docker for Windows GUI.

The Docker team wants you to use Docker for Windows like a regular Docker in Linux and not have to bother with virtual machine stuff.

Docker-machine is included in the same way you can install in Linux. It is for managing machines in the cloud for example, or accessing a remote Docker Engine. For example in Linux you issue your Docker commands in a natural way, but you can also have a virtual machine with Docker and manage it using docker-machine in your host. Now in Windows it works in the same way.

Regards

like image 20
Carlos Rafael Ramirez Avatar answered Oct 12 '22 04:10

Carlos Rafael Ramirez


Documentation docker-machine create

docker-machine create --driver virtualbox dev

or

docker-machine create -d virtualbox \
    --engine-label foo=bar \
    --engine-label spam=eggs \
    --engine-storage-driver overlay \
    --engine-insecure-registry registry.myco.com \
    foobarmachine
like image 16
Harold Castillo Avatar answered Oct 12 '22 06:10

Harold Castillo