Search code examples
ubuntudockerdocker-swarmdocker-machine

sudo: docker-machine: command not found


who has ever tried following this tutorial about Docker Swarm?

https://docs.docker.com/get-started/part4/

There is a section called : Create a cluster. What I wanted to do was to create a couple of VMs using docker-machine. Since I use ubuntu16.0.4 so I used following commands to get VirtualBox.

sudo apt-get update
sudo apt-get install virtualbox-5.2

After I installed VirtualBox, typed a command like :

docker-machine create --driver virtualbox myvm1

But it says : sudo: docker-machine: command not found

So I typed another command to check if I have installed VirtualBox correctly.

sudo virtualbox version

This opens the Oracle VM VirtualBox Manager, which means I did install VirtualBox correctly , but not sure.

Could anyone help me with a proper solution? Any help would be appreciated.


Solution

  • You need to install Docker Machine first on your local machine. If you use Ubuntu, just use this snippet (Update the version from the Official Repository Releases if needed) :

    $ curl -L https://github.com/docker/machine/releases/download/v0.16.0/docker-machine-`uname -s`-`uname -m` >/tmp/docker-machine &&
    chmod +x /tmp/docker-machine &&
    sudo cp /tmp/docker-machine /usr/local/bin/docker-machine