Docker is a containerization system that keeps your application’s running environment safe, simple, and consistent on all platforms, making development and deployment a breeze. This repo contains the workshop component of the presentation, where we walk through how to set up Docker configurations for development and distribution.
- Facebook event: https://www.facebook.com/events/276016843042664/
- Slideshow: https://slides.ubclaunchpad.com/workshops/guide-to-docker.pdf
- Video: https://www.youtube.com/watch?v=Lypf1iYiPFs
- Presenters: @bfbachmann, @bobheadxi
This project was bootstrapped with Create React App.
To get started, clone this repository by running the following commands in a directory of your choice:
git clone https://github.com/ubclaunchpad/workshop-guide-to-docker.git
cd workshop-guide-to-docker
Have a look at the example Dockerfile provided (demo.Dockerfile
). You can
build an image
from it with the following command:
docker build -f demo.Dockerfile -t my-app .
Then, create a container
using the image
you built and run it:
docker run --rm -it -p 8000:8000 my-app
You can then browse the directory contents of your image by visiting the site at the exposed port: http://localhost:8000/
-
start with an image that has Node.js
-
add an “entrypoint” command to install dependencies and run the website inside a Docker container
-
leverage volume mounting to allow code changes to be reflected instantly in a container
See the slides for more details!
The Docker for Development configuration is not good for distribution. Instead:
-
build a lightweight image optimized for distribution
-
run the container to serve the website
-
upload to Docker Hub so anyone can download and deploy your image (optional!)
See the slides for more details!