Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker for Machine: update #6364

Merged
merged 4 commits into from
Apr 3, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Machine: fix the install page
- shell does not have to be ugly
  - use variable to shorten long line
  - a line ending with && does not need a \
  - backquote are the past, use $(...)

- don't write text body within shell blocks

- don't propose to rm first docker-machine and then to use it

Signed-off-by: Akim Demaille <akim.demaille@docker.com>
  • Loading branch information
akimd committed Apr 3, 2018
commit fc70bd931b06b61f426ed3f315976daf3aa180b9
63 changes: 39 additions & 24 deletions machine/install-machine.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,26 @@ on GitHub.
If you are running on **macOS**:

```console
$ curl -L https://github.com/docker/machine/releases/download/v{{site.machine_version}}/docker-machine-`uname -s`-`uname -m` >/usr/local/bin/docker-machine && \
chmod +x /usr/local/bin/docker-machine
$ base=https://github.com/docker/machine/releases/download/v{{site.machine_version}} &&
curl -L $base/docker-machine-$(uname -s)-$(uname -m) >/usr/local/bin/docker-machine &&
chmod +x /usr/local/bin/docker-machine
```

If you are running on **Linux**:

```console
$ curl -L https://github.com/docker/machine/releases/download/v{{site.machine_version}}/docker-machine-`uname -s`-`uname -m` >/tmp/docker-machine && \
sudo install /tmp/docker-machine /usr/local/bin/docker-machine
$ base=https://github.com/docker/machine/releases/download/v{{site.machine_version}} &&
curl -L $base/docker-machine-$(uname -s)-$(uname -m) >/tmp/docker-machine &&
sudo install /tmp/docker-machine /usr/local/bin/docker-machine
```

If you are running with **Windows** with [Git BASH](https://git-for-windows.github.io/){: target="_blank" class="_"}:

```console
$ if [[ ! -d "$HOME/bin" ]]; then mkdir -p "$HOME/bin"; fi && \
curl -L https://github.com/docker/machine/releases/download/v{{site.machine_version}}/docker-machine-Windows-x86_64.exe > "$HOME/bin/docker-machine.exe" && \
chmod +x "$HOME/bin/docker-machine.exe"
$ base=https://github.com/docker/machine/releases/download/v{{site.machine_version}} &&
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"
```

> The above command works on Windows only if you use a
Expand Down Expand Up @@ -69,36 +72,48 @@ Confirm the version and save scripts to `/etc/bash_completion.d` or
`/usr/local/etc/bash_completion.d`:

```bash
scripts=( docker-machine-prompt.bash docker-machine-wrapper.bash docker-machine.bash ); for i in "${scripts[@]}"; do sudo wget https://raw.githubusercontent.com/docker/machine/v{{site.machine_version}}/contrib/completion/bash/${i} -P /etc/bash_completion.d; done

Then you need to run "source /etc/bash_completion.d/docker-machine-prompt.bash" in your bash terminal to tell your setup where it can find the file docker-machine-prompt.bash that you previously downloaded.
base=https://raw.githubusercontent.com/docker/machine/v{{site.machine_version}}
for i in docker-machine-prompt.bash docker-machine-wrapper.bash docker-machine.bash
do
sudo wget "$base/contrib/completion/bash/${i}" -P /etc/bash_completion.d
done
```

To enable the `docker-machine` shell
prompt, add `$(__docker_machine_ps1)` to your `PS1` setting in `~/.bashrc`.
Then you need to run `source
/etc/bash_completion.d/docker-machine-prompt.bash` in your bash
terminal to tell your setup where it can find the file
`docker-machine-prompt.bash` that you previously downloaded.

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](https://github.com/docker/machine/tree/master/contrib/completion/bash){: target="_blank" class="_"}.
You can find additional documentation in the comments at the [top of
each
script](https://github.com/docker/machine/tree/master/contrib/completion/bash){:
target="_blank" class="_"}.

## How to uninstall Docker Machine

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 each machine individually: `docker-machine rm <machine-name>`

To remove all machines: `docker-machine rm -f $(docker-machine ls -q)` (you might need to use `-force` on Windows)
To remove all machines: `docker-machine rm -f $(docker-machine ls
-q)` (you might need to use `-force` on Windows).

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](/docker-for-mac/index.md) or [Docker for
Windows](/docker-for-windows/index.md) environment, for example.

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

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](/docker-for-mac/index.md) or [Docker for
Windows](/docker-for-windows/index.md) environment, for example.

>**Note**: As a point of information, the `config.json`, certificates,
and other data related to each virtual machine created by `docker-machine`
Expand All @@ -110,8 +125,8 @@ servers.

## Where to go next

- [Docker Machine overview](overview.md)
- Create and run a Docker host on your [local system using virtualization](get-started.md)
- Provision multiple Docker hosts [on your cloud provider](get-started-cloud.md)
- [Docker Machine overview](overview.md)
- Create and run a Docker host on your [local system using virtualization](get-started.md)
- Provision multiple Docker hosts [on your cloud provider](get-started-cloud.md)
- [Docker Machine driver reference](/machine/drivers/index.md)
- [Docker Machine subcommand reference](/machine/reference/index.md)