sudo: docker-machine: command not found
Solution 1
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
Solution 2
The accepted answer contains outdated install instructions!
Up to date instructions for Docker Machine can be found in the official documentation here. This includes instructions for MacOS, Linux (including Ubuntu) & Windows with Git BASH. Full documentation can be found here.
While @sdey0081's answer is more or less correct, running the posted commands will result in an outdated version of Docker Machine being installed. The version it installs is v0.13.0
while the current release at the time of writing is v0.15.0
. You can find the available releases in the GitHub repo here.
Solution 3
On MacOS installing with brew is the simplest solution: brew install docker-machine
Solution 4
Just additional information with steps to the main answer:
1) To install docker-machine you need to write this as mantioned @coturiv:
$ 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 the error after running the command 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
be sure that you also installed virtualbox
:
sudo apt-get install virtualbox
3) If you get again the error like:
This computer doesn't have VT-X/AMD-v enabled. Enabling it in the BIOS is mandatory
try to run the command docker-machine create
using --virtualbox-no-vtx-check
like:
docker-machine create default --virtualbox-no-vtx-check
CHRIS LEE
You don't just need a website. You need a product that makes people want to stick around, whether it's a static site or a full-featured web app. That's where I come in. I am a veteran full-stack developer who can help you develop web and mobile applications - mainly Ruby and Node for the backend, Vue, Angular and React on the frontend. I am a software engineer who likes to keeps code clean and pixel-perfect design. Over the last 10 years, I have specialized in helping industrial and scientific clients build e-commerce sites and related services, and my biggest strength is making complex tasks easy for non-tech people. Skills: MERN, MEAN stack Expert. ✔️ Frontend - Vue.js, React.js, Angular, PureScript, Typescript, Flex/Bootstrap, PHP, HTML ✔️ Native Mobile - Swift, Java, Kotlin ✔️ Cross-Platform Mobile - React Native ✔️ Backend- Ruby on Rails, Node.js, PHP Laravel ✔️ Database - Firebase, MongoDB, Postgre, SQL, MySQL ✔️ Browser Extension - Chrome, Safari, Mozilla Firefox ✔️ 3rd Party APIs - Stripe, Plaid, Tradeit, IEX, EmmaAI ✔️ Source Control / CI - Git, GitHub, GitLab, BitBucket ✔️ Deployment - AWS(Amazon), GCP(Google Cloud), Heroku, DigitalOcean ✔️ Task management tool - JIRA, Asana, Pivotal Tracker, Trello ✔️ Development environment - Mac OS Mojave, Ubuntu, Win10 ✔️ Development devices - iMac Pro, iPhone X, Samsung Galaxy S6
Updated on July 09, 2022Comments
-
CHRIS LEE almost 2 years
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.
-
l0k3ndr over 6 yearsI used this inside my virtualbox, but it didn't work. The binary gets created with "Not Found" string inside it.
-
DaveLak almost 6 yearsThis answers installs an outdated version of Docker Machine. I've added an answer with links to up to date instructions and the releases page on GitHub.
-
Roel almost 6 yearsThis one is the real answer referring to the official documentation is just right.
-
Teekin almost 6 yearsThis is the correct answer, for sure. Still I have to say that I'm a bit troubled by how comfortable people are expected to be with downloading and running binaries on Linux systems, these days.
-
Croll about 5 yearsThe big difference is that according to docs, you have to install docker on your machine. That will increase overhead significantly just to use docker-machine.
-
DaveLak about 4 yearsthis answer suffers the same issue of recommending an outdated version
-
invzbl3 about 4 years@DaveLak that's why I wrote as additional information to the main answer. It can be helpful if you reproduce these issues and want to understand/analyze why it happens to you while trying to solve the main problem, but also you can improve it if you know how.