Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
562 views
in Technique[技术] by (71.8m points)

ubuntu - 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.

question from:https://stackoverflow.com/questions/47301434/sudo-docker-machine-command-not-found

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...