# Docker

# What is Docker?
- Docker is a standard for Linux containers
- A "Container" is an isolated runtime inside of Linux
- A "Container" provides a private machine like space under Linux
- Containers will run under any modern Linux Kernel

### Containers can:
- Have their own process space
- Their own network interface
- 'Run' processes as root from inside the container
- Have their own disk space 
	- Can also share with Host

[![](https://bookstack.mitchellhenschel.com/uploads/images/gallery/2022-04/scaled-1680-/image-1650156287030.png)](https://bookstack.mitchellhenschel.com/uploads/images/gallery/2022-04/image-1650156287030.png)

## Docker Terminology
- Docker Image - The representation of a Docker Container.
- Docker Container - The standard runtime of Docker
- Docker Engine - The code which manages Docker stuff

[![![7d249b52aac81e51e686581a3420501a.png](:/d7fbc4ab97964f639cbac24b67a6f153)](https://bookstack.mitchellhenschel.com/uploads/images/gallery/2022-04/scaled-1680-/image-1650156296646.png)](https://bookstack.mitchellhenschel.com/uploads/images/gallery/2022-04/image-1650156296646.png)

## Docker Editions
### Docker Community Edition 
- CaaS (Contianer as a Service platform subscription)
- Quarterly Releases
- Enterprise Class Support
### Docker Enterprise Edition
- Free for developers and operations
- Monthly 'edge' release for devs and quartly releases for operations

Docker uses the release number of year.month.version.edition (yy.mm.v.ed)

# Docker Images
- Images are immutable
- Images are built in layers
	- Each layer is an immutable file, but is a collection of files and directories
	- Layers recive an ID calculated via a SHA 256 hash of the layer contents
		- So if layer contents change *at all*, the SHA 256 hash changes also
- Running *docker images* gives the first 12 characters of the hash in 'Image ID'
- The hash values of images are referred to by 'tag' names
- The format of the full tag name is: [REGISTRYHOST/][USERNAME/]NAME[:TAG]
	- For Registry Host 'registry.hub.docker.com' is inferred
	- For ':TAG' - 'latest' is default and inferred
	- Full tag example: 'registry.hub.docker.com/mongo:latest'
- Old volumes and containers can pile up and use up disk space, cleanup is important