Skip to content

#19 Adding code notes for Docker-Machine #123

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 3 additions & 2 deletions docker-machine/notes/01-installing-docker-machine.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Notes coming soon.
**Docker machine is no longer supported and it is recommended that native Docker apps are used to control local and remote Docker engines.**

[Edit these notes](https://github.com/howToCodeWell/course-notes)
## Install Docker Machine
To install Docker machine please [follow the guide on GitHub](https://github.com/docker/machine/releases/tag/v0.16.2) using the latest version of Docker Machine.
17 changes: 15 additions & 2 deletions docker-machine/notes/02-create-a-docker-machine.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
Notes coming soon.
## Creating a Machine
Run the following to create a Docker Machine

[Edit these notes](https://github.com/howToCodeWell/course-notes)
Where the <driver> flag defines the virtual environment driver used to create the machine. <name> is the name that is given to the Machine. By default the name `default` will be used.
```bash
docker-machine create --driver=<driver> <name>
```

## Listing Machines
To list the Docker Machines use the `ls` command like so
```bash
docker-machine ls

NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
default * virtualbox Running tcp://192.168.99.187:2376 v1.9.1
```
24 changes: 22 additions & 2 deletions docker-machine/notes/03-docker-machine-switch.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
Notes coming soon.
## Docker Machine environments

[Edit these notes](https://github.com/howToCodeWell/course-notes)
Each Docker Machine will have its own set of environment variables. These can be access using the following command
```bash
docker-machine env <name>
```

Where `<name>` is the name of the selected Machine.
The output would be similar to the following

```bash
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://172.16.62.130:2376"
export DOCKER_CERT_PATH="/Users/<yourusername>/.docker/machine/machines/default"
export DOCKER_MACHINE_NAME="default"
```

## Connect to a Docker Machine
To switch to a Docker Machine the environment variables must be exported to your shell. This is done like so
```bash
eval "$(docker-machine env default)"
```
Once the Docker Machine environment variables have been evaluated to the current shell the containers within that machine will be accessible by your local Docker commands.
16 changes: 14 additions & 2 deletions docker-machine/notes/04-docker-machine-commands.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
Notes coming soon.
## Get the Docker Machine IP
```bash
docker-machine ip default
<THE_IP_OF_THE_MACHINE>
```

[Edit these notes](https://github.com/howToCodeWell/course-notes)
## Stop the Docker Machine
```bash
docker-machine stop default
```

## Start the Docker Machine
```bash
docker-machine start default
```