These are the commands that are outlined in the article on how to build, manage, and destroy Docker images and containers.
Copy the sources down and do the build:
$ cd DockerDemo/
$ docker build --rm -t hquinn/dockerdemo .
View images currently on your system:
$ docker images | grep hquinn
Change directory and run container:
$ cd ../CodeProjects/DaveBeingSassy/
$ docker run -d -p 80 --name Project1 --mount type=bind,source="$(pwd)"/app/,target=/var/www/html/ hquinn/dockerdemo
We need to find the port we want to navigate to:
$ docker ps -a | grep Project1
$ curl http://localhost:<port>
Alternatively, direct your browser to: http://localhost:\
Enter a shell session in a container:
$ docker exec -it Project1 /bin/bash
Stop a container, delete the container, delete the base image:
# If you're still in the container's shell:
$ exit
# Otherwise:
$ docker stop Project1
$ docker rm Project1
$ docker rmi hquinn/dockerdemo