Docker 101
What is Docker?- Is a technology
- An open-source engine
- Automates the deployment of any application as a lightweight, portable, self-sufficient container that will run virtually anywhere
- Allow us to incorporate and store our code and its dependencies in to a neat little package -an image
- In Java world: “Write once, run anywhere”
- In DevOps world: “Build once, run anywhere”
- Container is a standardized unit of software
- Container image is a lightweight, standalone, executable package of software that includes everything needed to run an application: code, runtime, system tools, system libraries and settings
- Container images become containers when they run on Docker Engine
What is Container and Container Image?
- “Build once, Run anywhere”

- Similar resource isolation and allocation benefits
- Containers virtualize the operating system instead of hardware
- Containers are more portable and efficient
- Containers are an abstraction at the app layer
- VMs are an abstraction of physical hardware turning one server into many servers
- Multiple containers can run on the same machine
- The hypervisor allows multiple VMs to run on a single machine
- Containers take up less space than VMs(tens of MBs/tens of GBs)
- VMs can also be slow to boot

- Dockerfile
- Docker Image
- Docker registry
- Container
- Docker-compose
- Swarm
- Service
- Stack
- A Dockerfile is a text document
- Contains all the commands a user call on the command line to assemble to an image
- Demo-0
- docker build -t kadirtaskiran/nginx:know-how .
- Docker registry
- docker login
- docker images
- docker push kadirtaskiran/nginx:know-how
- Run the image
- docker run -d –name know-how-nginx -p 8080:80 kadirtaskiran/nginx:know-how
- docker ps
- docker logs know-how-nginx
- docker exec -it know-how-nginx /bin/sh
- docker cp index.html know-hownginx:/usr/share/nginx/html/index.html
- docker run -d –name know-how-nginx-2 -p 8081:80 -v /Users/kadirtaskiran/Desktop/dockerdemos/0/website_files:/website_files kitematic/hello-world-nginx
- Change file context and see the changes
- docker volume
- docker network etc.
- Kitematic
- Docker Compose is a tool for defining and running multi-container Docker applications.
- YAML file to configure your application’s services.
- demo-1
- docker-compose up -d
- Docker Swarm Mode
- Cluster management integrated with Docker Engine
- Declarative service model with YAML files
- Scaling
- Desired state reconciliation
- Multi-host networking
- Service discovery
- Load balancing
- Rolling updates
- https://training.play-with-docker.com/swarm-mode-intro/
0 Comments
Share