10 Oct 2023
Docker & Linux Containers
Difference between Virtualization and Containerization:
The base of the docker technology is IMAGE which is an archive of software stack that will run as virtual operating system along with any application code it will use. You can build images from docker hub.
A sample dockerfile - create an image
#Create a webserver on Ubuntu
FROM ubuntu:18.04 -- base image - 1st layer
RUN apt-get update
RUN apt-get install -y apache2 --package manager - 2nd layer
RUN echo "Welcome to my web site" > /var/www/html/index.html
EXPOSE 80
Image hosting:
Docker Hub
Docker Registry
Storage:
Docker Volumes - virtual partition stored within the docker file system on the host machine and accessible to your containers
Third-party solutions - Azure storage
Manage docker container's clusters:
https://docs.docker.com/engine/swarm
Kubernetes
ECS, EKS from AWS
Installing Docker engine on Linux:
- Set up encryption keys
- Add docker repo to Apt
- Install Docker