VMs v/s Dockers
- Introduction to Dockers and containers
Docker File
- A bunch of instructions (to package the application code and dependencies) that helps create a Docker Image
- Each operation is a layer in the file. If any change is made, only that layer is rebuilt
#format: INSTRUCTION arguments
FROM python:3.8
LABEL maintainer="your-name"
COPY . /app
WORKDIR /app
RUN pip install -r requirements.txt
CMD ["python", "app.py"]
Docker Image
- A read-only template that is used to spin-up a runnable instance of an application
# build an image
# OPTIONS - optional; define extra configuration
# PATH - required; sets the location of the Dockefile and any referenced files
docker build [OPTIONS] PATH
# Where OPTIONS can be:
-t, --tag - set the name and tag of the image
-f, --file - set the name of the Dockerfile
--build-arg - set build-time variables
# Find all valid options for this command
docker build --help
Docker Registry
- A public registry where people can access your builds and images. (Similar to the NPM registry?)
- It's recommended to tag your images (otherwise an auto generated ID will be allocated to it)
Kubernetes
https://youtu.be/cC46cg5FFAM
- Open-source
- Portability
- Platform agnostic
- Scalability (HPA – Horizontal Portable Auto-scaler)
- Elasticity