37

I recently upgraded Docker Desktop for Mac to version 2.2.0.0, and now when try to run a docker-machine command I am getting an error:

$ docker-machine --version

docker-machine: command not found

Docker Machine used to be installed with Docker, but it appears in the latest docs that this is no longer the case. What is the replacement or do I need to install Docker Machine from somewhere else?

8 Answers 8

21

Docker machine has been removed from later versions of Docker Desktop. Your going to need the docker-toolbox package.

Read here for install and co existence of the packages.

https://docs.docker.com/docker-for-mac/docker-toolbox/#docker-toolbox-and-docker-desktop-coexistence

2
19

For Windows, if you have chocolatey installed, you follow the steps:

  1. open a command shell with "Run as Administrator" selected (I tested this on my work laptop).
  2. run "choco install docker-machine"
4
  • 1
    I literally say that I'm using a Mac in the question. Why add this here?
    – wogsland
    Commented Oct 23, 2020 at 11:46
  • 23
    I came here from a search and seen the title "docker-machine: command not found". I am Windows user. Somebody might drop like me and find this helpful.
    – razvanone
    Commented Oct 23, 2020 at 12:17
  • 8
    I'm a windows user. Thanks for this!
    – Isaac Pak
    Commented Jan 19, 2021 at 2:17
  • 1
    @wogsland, "I literally say that I'm using a Mac in the question. Why add this here?," maybe this expectation is short-sighted, seeing the problem is not specific to only one OS Commented Feb 2, 2022 at 19:36
14

Docker machine is now merged into the docker command, So instead of using

docker-machine init

Use

docker swarm init

And instead of

docker-machine join

Use

docker swarm join

for more command just use this:

docker swarm --help
1
  • What about docker-machine create? I guess we should install docker-machine after all.
    – Mohsenasm
    Commented Oct 11, 2023 at 8:20
11

If you already have docker-desktop & want the docker-machine command, then brew install docker-machine does the trick.

My versions of the binaries in usr/local/bin/docker and usr/local/bin/docker-compose did not change, & the version of the docker client & server, but I got the docker-machine binary extra.

run unset ${!DOCKER_*} if you want to use docker-desktop.

The docker docs are a bit confusing because they seem to address the case where you have docker-machine first, not the case where you have desktop first.

1
  • 1
    how to install docker-machine on windows? Commented Aug 17, 2021 at 10:34
4

Did you try brew to install it as they removed docker-machine from v2.2.0?

brew install docker-machine
3

You basically need to install Docker Machine first on your local machine. Reference :- https://github.com/docker/machine/releases

$ 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
0
1

Try and run this command on bash:

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

Click here to know more about docker-machine installation

It worked for me.

1
  • 23
    I highly recommend not simply copying and pasting a command that downloads and executes an external script from a random stackoverflow post.
    – Git.Coach
    Commented Jul 4, 2020 at 17:47
0

Try this (both inside, and outside of container):

ss -nputl

Not the answer you're looking for? Browse other questions tagged or ask your own question.