DanLevy.net

Docker === Love

Docker can do :allthethings:!

Hero image for Docker === Love

Docker Can Do Everything!*

Historical note: this is a 2015 snapshot of Docker enthusiasm and local-dev habits, preserved mostly as a time capsule. Treat the commands and security posture as starting points to modernize, not production guidance.

Improve your process for:

  1. Testing Dev Tools & Servers WITH VIRTUALLY ZERO risk of messing up dependencies on your PC
  2. Testing your software
  3. Makes you write more idempotent, modular code… (I’ll write how to actually realize this in a follow up)

There may seem like a huge volume of new stuff to learn, don’t let that stop you from getting started.

Notes


EXAMPLES

nginx

Terminal window
# Note: using host-based, shared folders
#(shared folders are not possible with the VOLUME Dockerfile cmd)
sudo docker run --name web01 -d -p 8181:80 \
-v $(NGINX_DIR)/etc:/etc/nginx \
-v $(NGINX_DIR)/log:/var/log/nginx \
-v $(NGINX_DIR)/www:/var/www/html \
nginx:latest
## Local data, isolated within instance
sudo docker run --name web01 -d -p 8181:80 nginx:latest
# nodejs
sudo docker run --name nodejs01 -d -p 3300:3300 -p 4433:4433 nodejs:latest

Credits: https://dockerfile.github.io/#/nginx Docker will make your life easier throughout the entire SDLC.