Install Docker Machine

转自官网文档:https://docs.docker.com/machine/install-machine/


On macOS and Windows, Machine is installed along with other Docker products when you install the Docker for MacDocker for Windows, or Docker Toolbox.

If you want only Docker Machine, you can install the Machine binaries directly by following the instructions in the next section. You can find the latest versions of the binaries are on the docker/machine release page on GitHub.

Installing Machine Directly

  1. Install the Docker binary.

  2. Download the Docker Machine binary and extract it to your PATH.

    If you are running on macOS:

    $ curl -L https://github.com/docker/machine/releases/download/v0.9.0-rc2/docker-machine-`uname -s`-`uname -m` >/usr/local/bin/docker-machine && \
    chmod +x /usr/local/bin/docker-machine
    

    If you are running on Linux:

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

    If you are running with Windows with git bash:

    $ if [[ ! -d "$HOME/bin" ]]; then mkdir -p "$HOME/bin"; fi && \
      curl -L https://github.com/docker/machine/releases/download/v0.9.0-rc2/docker-machine-Windows-x86_64.exe > "$HOME/bin/docker-machine.exe" && \
      chmod +x "$HOME/bin/docker-machine.exe"
    

    Otherwise, download one of the releases from the docker/machine release page directly.

  3. Check the installation by displaying the Machine version:

    $ docker-machine version
    docker-machine version 0.8.2, build e18a919
    

Installing bash completion scripts

The Machine repository supplies several bash scripts that add features such as:

  • command completion
  • a function that displays the active machine in your shell prompt
  • a function wrapper that adds a docker-machine use subcommand to switch the active machine

To install the scripts, copy or link them into your /etc/bash_completion.d or /usr/local/etc/bash_completion.d directory. To enable the docker-machine shell prompt, add $(__docker_machine_ps1) to your PS1 setting in ~/.bashrc.

PS1='[\u@\h \W$(__docker_machine_ps1)]\$ '

You can find additional documentation in the comments at the top of each script.

How to uninstall

To uninstall Docker Machine:

  • Remove the executable: rm $(which docker-machine)

  • Optionally, remove the machines you created.

    To remove each machine individually: docker-machine rm <machine-name>

    To remove all machines: docker-machine rm -f $(docker-machine ls -q)

Removing machines is an optional step because there are cases where you might want to save and migrate existing machines to a Docker for Mac or Docker for Windows environment, for example.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要在Ubuntu 16上安装Docker Machine,您可以按照以下步骤进行操作: 1. 首先,将Docker的GPG密钥添加到您的APT密钥环中。您可以使用以下命令执行此操作: ``` sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 7EA0A9C3F273FCD8 ``` 2. 接下来,将Docker的源添加到您的APT源列表中。您可以使用以下命令将Docker源添加到`/etc/apt/sources.list`文件中: ``` echo "deb [arch=amd64 https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list ``` 3. 现在更新APT软件包索引,以获取Docker软件包的最新版本。使用以下命令执行此操作: ``` sudo apt update ``` 4. 最后,安装Docker Machine。使用以下命令执行此操作: ``` sudo apt install docker-machine ``` 完成以上步骤后,您应该成功在Ubuntu 16上安装了Docker Machine [1][3。 引用: `curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -` `Docker-Machine功能远程主机或者虚拟机自动安装Docker。方便管理多个实例,无论系统是windows、linux还是Mac。安装Docker-Machine $ base=https://github.com/docker/machine/releases/download/v0.16.0 && curl -L $base/docker-machine-$(uname -s)-$(uname -m) >/tmp/docker-machine && sudo install /tmp/docker-machine /usr/local/bin/docker-machine` `add-apt-repository “deb [arch=amd64 https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable”`<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [Ubuntu16.04安装Docker](https://blog.csdn.net/kk68171930/article/details/79133458)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *2* [Ubuntu Docker-Machine](https://blog.csdn.net/qq_27559331/article/details/89886781)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值