docker
- container - isolated process with all of the files it needs to run; instance of an image
- image - standardized package that includes all of the files, binaries, libraries, and configurations to run a container; immutable (not modifiable after creation) and layered
- self-contained (no dependencies), isolated/independent (doesnt interact with other containers or the host), portable (works on different platforms; data center, cloud, Windows, Linux...), faster than VMs and less disk space
- registry - centralized location for storing and sharing container images; contains one or more repos
- docker compose - define all necessary containers and their configurations in a single YAML file
- dockerfile - text-based document used to create a container image
docker ps - show running containers; -a to show the stopped ones too
docker stop _ID_ - stop a running container; full id is not necessary, only enough to make it unique (even just the first character)
docker run _IMAGE_ - creates and run a new container from a image; -d - detached mode; -a - attached mode; --rm - remove the container when it stops; -p [[_IP_:]_HOST_PORT_]:_CONTAINER_PORT_ - ports
docker attach _CONTAINER_ - attach to a container
docker start _ID_ - start a stopped container
docker logs _ID_ - show container logs
docker rm _ID_ - delete a container
docker rmi _IMAGE_ - delete an image
docker { images | image ls } - list downloaded images
- tag - an optional identifier used to specify a particular version or variant of the image. If no tag is provided, Docker defaults to latest
volumes and bind mounts
- anonymous volume - single container bound, cant be shared; useful for temp data storage
- named volume - not tied to a specific container, shareable; useful for storing data across containers
- bind mount - location on the host file system is known; useful for editable data