Docker objects
- Dockerfile
- A dockerfile is a editable text file that contains instructions needed to create an image in terminal.
- The instructions docker provided:
- FROM: Defines base image
- RUN: Executes arbitrary commands
- CMD: Defines default command for container execution
- Image
- Use for createing Docker containers and Read-only template with instructions
- Built using instructions in a Dockerfie; a new read-only image layer is creaed for each instruction
- A writeable layer is added when an image layer is created for each instruction
- Layers can be shared between images, which saves disk space and network bandwidth
- image naming: hostname/repository:tag, dockr.io/ubuntu:18.04
- Container
- arunnable instance of an image
- Can be created, stopped, started or deleted using the Docker API or CLI
- Can connect to multiple networks, attach storage, or create a new image based on its current state
- Is well isolated from othe containers and its host machine
- Network: Networks are used for the isolated container communication
- Storage: Docker uses volumes and bind mounts to persist data even after a container stops
- Other objects Plugins Add-ons: Storage plugins provide the ability to connect to external stroage platforms