Sudo: docker-machine: command not found

Has anyone ever tried following this guide about Docker Swarm ?

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

There is a section: Create a cluster . I would like to create a pair of virtual machines using a docking machine. Since I use ubuntu16.0.4, so I used the following commands to get VirtualBox.

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

After installing VirtualBox, enter the following command:

docker-machine create --driver virtualbox myvm1

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

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

sudo virtualbox version

This opens the Oracle VM VirtualBox Manager , which means that I installed VirtualBox correctly but am not sure.

Can someone help me with the right solution? Any help would be appreciated.

+26
source share
4 answers

You must first install the Docker Machine on your local computer. If you use Ubuntu , just use this snippet (update the version from the official releases of the repository if necessary):

 $ 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 
+38
source

The accepted answer contains outdated installation instructions!

Current instructions for the Docker Machine can be found in the official documentation here . This includes instructions for MacOS, Linux (including Ubuntu), and Windows with Git BASH. Full documentation can be found here .

Although @ sdey0081's answer is more or less correct, executing published commands will install an outdated version of Docker Machine. The version that it installs is v0.13.0 while the current version is at the time of writing v0.15.0 . You can find available releases in the GitHub repository here .

+11
source

The docker says: "On macOS and Windows, the machine installs along with other Docker products when you install Docker for Mac, Docker for Windows, or the Docker Toolbox."

But why not on Linux? We also need a docker machine on Linux, right? Can someone clarify please?

0
source

Just additional information with steps to the main answer:

1) To install the docker machine , you need to write this as @coturiv above:

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

2) If you get an error after running the docker-machine create :

 Error creating machine: Error with pre-create check: VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path 

make sure you also installed virtualbox :

 sudo apt-get install virtualbox 

3) If you get an error again, for example:

 This computer does not have VT-X/AMD-v enabled. Enabling it in the BIOS is mandatory 

try running the docker-machine create using --virtualbox-no-vtx-check , for example:

 docker-machine create default --virtualbox-no-vtx-check 
0
source

Source: https://habr.com/ru/post/1273384/


All Articles