YouTip LogoYouTip

Docker Machine

> Docker Machine is a tool created in the early days of Docker for creating and managing Docker hosts. However, with the maturation of Docker Desktop, Terraform, and Kubernetes, it has completed its historical mission and been fully replaced. Docker Desktop **fully replaces** Docker Machine in local development scenarios and is no longer suitable for actual use. | Comparison | Docker Machine | Docker Desktop | | --- | --- | --- | | Product Positioning | Docker host creation and management tool | Integrated local Docker development environment | | Primary Use | Create VMs and install Docker Engine | Run Docker directly locally | | Typical Era of Use | Early Docker (1.x to 18.x) | Current mainstream | | macOS / Windows Support | Indirect (depends on VirtualBox) | Native support | | Requires Additional Virtualization Software | Yes (VirtualBox / VMware) | No (built-in) | | Docker Engine Management | Manual/Semi-automatic | Fully automatic | | Usage Complexity | High | Low | | Provides GUI | No | Yes | | Kubernetes Support | Not supported | Optional built-in | | Multi-Docker Host Management | Supported | Not supported (focuses on single machine) | | Suitable for Production Environment | Not suitable | Not suitable | | Official Maintenance Status | Basically stopped | Continuously active | | Current Recommendation | ❌ Not recommended | βœ… Strongly recommended | ### Introduction Docker Machine is a tool that allows you to install Docker on virtual hosts, and you can use the docker-machine command to manage the hosts. Docker Machine can also centrally manage all docker hosts, such as quickly installing docker on 100 servers. !(#) The virtual hosts managed by Docker Machine can be on-premises or cloud providers such as Aliyun, Tencent Cloud, AWS, or DigitalOcean. Using the docker-machine command, you can start, check, stop and restartManaged hosts, and also upgrade the Docker client and daemon, as well as configure the Docker client to communicate with your hosts. !(#) * * * ## Installation Before installing Docker Machine, you need to install Docker first. Docker Machine can be installed and used on multiple platforms, including Linux, macOS, and Windows. ### Linux Installation Command $ base=https://github.com/docker/machine/releases/download/v0.16.0 && curl -L $base/docker-machine-$(uname -s)-$(uname -m) >/tmp/docker-machine && sudo mv /tmp/docker-machine /usr/local/bin/docker-machine && chmod +x /usr/local/bin/docker-machine ### macOS Installation Command $ base=https://github.com/docker/machine/releases/download/v0.16.0 && curl -L $base/docker-machine-$(uname -s)-$(uname -m) >/usr/local/bin/docker-machine && chmod +x /usr/local/bin/docker-machine ### Windows Installation Command If you are on Windows platform, you can use (https://git-for-windows.github.io/) and enter the following command: $ base=https://github.com/docker/machine/releases/download/v0.16.0 && mkdir -p "$HOME/bin" && curl -L $base/docker-machine-Windows-x86_64.exe > "$HOME/bin/docker-machine.exe" && chmod +x "$HOME/bin/docker-machine.exe" Check if the installation was successful: $ docker-machine version docker-machine version 0.16.0, build 9371605 > **Note:** The installation instructions are also available in each version's changelog: [https://github.com/docker/machine/releases](https://github.com/docker/machine/releases) * * * ## Usage This chapter introduces the usage of docker-machine through virtualbox. The operations for other cloud service providers are basically the same. For specific details, please refer to each service provider's guidance document. ### 1、List Available Machines You can see that there is only the default virtual machine here. $ docker-machine ls [!(#)](#) ### 2、Create a Machine Create a machine named test. $ docker-machine create --driver virtualbox test * **--driver**: Specifies the driver type used to create the machine, which is virtualbox. [!(#)](#) ### 3、View the Machine's IP $ docker-machine ip test [!(#)](#) ### 4、Stop the Machine $ docker-machine stop test [!(#)](
← Lua GotoEcharts Pie β†’