docker run hello-world
docker — the clientrun — create and start a containerhello-world — the image to use docker run -d -p 8080:80 --name web nginx
-d — detached (background)-p 8080:80 — map host 8080 to container 80--name web — a friendly namehttp://<vm-ip>:8080docker ps — running containers (-a for all)docker images — local imagesdocker logs web — a container's outputdocker exec -it web bash — a shell inside itdocker stop web / docker rm web — stop / removedocker pull ubuntu:22.04 — download an imagenginx:1.27, nginx:latestlatest is just a default tag, not "newest guaranteed" — pin realdocker run -> created + started
docker stop -> stopped (state kept)
docker start -> running again
docker rm -> gone (writable layer deleted)
Data in the writable layer dies with the container — hence volumes (next).
docker rm <name> — remove a containerdocker rmi <image> — remove an imagedocker system prune — reclaim space from unused stuff (careful)