###TL;DR
- Install the Docker Toolbox from : https://www.docker.com/toolbox
- Open on the Github Terminal application (CLI).
- Run these commands at the CLI.
docker-machine create --driver virtualbox --virtualbox-host-dns-resolver default
docker-machine env --shell powershell default | Invoke-Expression
docker run -ti debian /bin/bash
###Long Form
- Install the Docker toolbox following these instructions.
- We will use the Github Terminal Icon installed as part of the Github Install for our CLI. i.e. Powershell
- The 3rd line above creates a virtual machine with the name defaul.
- The 4th line above sources the default VM into your environment so the docker client can connect to the vm/host.
- The 5th line above runs an image and creates a container. The image is downloaded from DockerHub and ran locally. The -ti option tells docker that you want to run this container interactively. The
/bin/bash
argument tell the doecker you want to land on the shell; bash in this case.
###Advanced Uses
####Where's my data?
Sometimes you need to run some analysis on data and you need access to is within your container. You can easily do this using docker volumes.
docker run -ti -v ./data:/opt/data -w /opt/data debian /bin/bash
- -v => local-path:container-path : maps the local path to the container path.
- -w => set the working directory of the container.