diff --git a/docker-machine/notes/01-installing-docker-machine.md b/docker-machine/notes/01-installing-docker-machine.md index 0c98a13..592ad44 100644 --- a/docker-machine/notes/01-installing-docker-machine.md +++ b/docker-machine/notes/01-installing-docker-machine.md @@ -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) \ No newline at end of file +## 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. diff --git a/docker-machine/notes/02-create-a-docker-machine.md b/docker-machine/notes/02-create-a-docker-machine.md index 0c98a13..1fe97e8 100644 --- a/docker-machine/notes/02-create-a-docker-machine.md +++ b/docker-machine/notes/02-create-a-docker-machine.md @@ -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) \ No newline at end of file +Where the flag defines the virtual environment driver used to create the machine. is the name that is given to the Machine. By default the name `default` will be used. +```bash +docker-machine create --driver= +``` + +## 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 +``` \ No newline at end of file diff --git a/docker-machine/notes/03-docker-machine-switch.md b/docker-machine/notes/03-docker-machine-switch.md index 0c98a13..5e4b936 100644 --- a/docker-machine/notes/03-docker-machine-switch.md +++ b/docker-machine/notes/03-docker-machine-switch.md @@ -1,3 +1,23 @@ -Notes coming soon. +## Docker Machine environments -[Edit these notes](https://github.com/howToCodeWell/course-notes) \ No newline at end of file +Each Docker Machine will have its own set of environment variables. These can be access using the following command +```bash +docker-machine env +``` + +Where `` 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//.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. diff --git a/docker-machine/notes/04-docker-machine-commands.md b/docker-machine/notes/04-docker-machine-commands.md index 0c98a13..e2a4039 100644 --- a/docker-machine/notes/04-docker-machine-commands.md +++ b/docker-machine/notes/04-docker-machine-commands.md @@ -1,3 +1,15 @@ -Notes coming soon. +## Get the Docker Machine IP +```bash +docker-machine ip default + +``` -[Edit these notes](https://github.com/howToCodeWell/course-notes) \ No newline at end of file +## Stop the Docker Machine +```bash +docker-machine stop default +``` + +## Start the Docker Machine +```bash +docker-machine start default +``` \ No newline at end of file