Docker Overview
2017-12-19
term | comment |
---|---|
image | Lightweight, executable snapshop of an application to run. Holds code, env, libs, runtime, config files, etc. |
container | Executed, running image. Runs completely isolated from host environment. |
Kernel | One Docker Kernel per host. It's a layer between containers and Host OS, that allows containers to run natively. |
Service | A service runs multiple replicas of a container. Handles load balancing, sclaing, etc, in prod. In that contaxt, a container is called a task . |
App | It's a swarm. Manages multiple services and how they interact between each other. Docker-managed SoA in a way. |
Swarm Group | Group of machines (physical or virtual) -called nodes- running multiple apps in a cluster. Swarm Manager is 1 machine controlling the others (send commands etc). |
Docker Cheatsheet
command | comment |
---|---|
docker login |
login through CLI |
docker run <img> |
run <img> |
docker build . |
build image from Dockerfile located at . |
docker image ls |
list all local images |
docker container ls |
list all running containers |
docker container stop <id> |
stop container with <id> |
docker service ls |
list all running services |
docker service ps <name> |
list tasks (containers) running inside service <name> |
docker swarm init |
init a swarm app (required for docker-compose) |
docker stack deploy c- docker-compose.yml <name> |
run swarm app with <name> |
docker stack rm <name> |
take down service <name> |
docker swarm leave |
remove machine from swarm. --force required for host |