Container = OS + Configs + Code + etc.
Advantages of containerization:
- App works out of the box; no need to install and configure dependencies -
- "if it runs on your machine, it runs anywhere"
- App always runs in the same environment, no matter where it's distributed
- Allows you to sandbox projects in their own environments - better security, no shared dependency conflicts between different projects (e.g., different versions of PHP)
- Lowered overhead (CPU, disk space) and hassle compared to running a virtual machine
Docker - tool for creating, configuring, deploying, running containers
Dockerfile - commands and instructions that will be automatically executed in sequence in the docker environment for building a new docker image. executed during "docker build"
Install:
- Docker Desktop
- (Docker Toolbox for) Kitematic - GUI tool for managing docker containers
Container Orchestration - scheduling, networking, and distribution among multiple containers.
Tools for orchestration:
- Kubernetes
- "Children's guide" to Kuberenetes: https://www.youtube.com/watch?v=4ht22ReBjno
- Pods - contain containers that are tightly coupled
- Replication Controllers - provide pod templates and manages/scales pods
- k8s Service - provides IP address for persistent access
- Volume - storage
- Namespace -
- Swarm
Richard's Shiny Server - uses client-side processing
Question re: terms — Images vs Containers vs Instances vs Templates
Templates:
- In DockerFile syntax: FROM <template>
- Any image can be pushed to Docker Hub (a tool that's used to explore docker templates)
- docker images lists the revisions from the original template (cumulative, non-overlapping)
- Starting from alpine, joe runs dockerfile --> can push image (named "alpine-joe") to Docker Hub as another template for others to use
- Someone else downloads the template --> run "docker images" in the command line --> lists all incremental revisions to the original image