SlideShare a Scribd company logo
1 of 17
Introduction - Docker &
Docker Compose
Docker Ahmedabad Meetup
About Me
Ketan Parmar
● Education: Ph.D Computer Science (Grid Computing)
● Experience: 10 years
● Twitter: @kpbird
● LinkedIn: https://www.linkedin.com/in/kpbird/
● Books Review:
○ Mastering AWS Development
○ Developing RESTful Web Services with Jersey 2.0
History
1. Session Based Computing
2. Non-Session Based Computing (eg. VDI or VM)
3. Containers
Why Containers?
1. Simplifying Configuration
2. Code Pipeline Management
3. Developer Productivity
4. App Isolation
5. Server Consolidation
6. Debugging Capabilities
7. And more..
VM vs Containers
Deploy
TERMINOLOGY
1. Docker client: command line that can be installed on Mac OS X or Windows to control most of the Docker
workflow and talk to Docker servers
2. Docker server: Docker running in daemon mode on a Linux server. The servers starts, runs, and stops/destroys
containers.
3. Docker images: layered filesystems described via metadata that represent all the dependencies necessary to
run an application.
4. Docker repository: the library of available Docker images, can be public (Docker Hub) or private
5. Docker container: a single instance of a Linux container built from the Docker image. There can be many
containers built from a single Docker image.
6. Docker host: the underlying Linux operating system that hosts the Docker daemon
7. Docker Hub: public repository of Docker images
8. Docker Trusted Registry: private image repository
9. Docker Toolbox: specialized installer for Docker tools on Mac and Windows
10. Docker Machine: automated Docker provisioning
11. Docker Swarm: host clustering and container scheduling
12. Docker Compose: define multi-container applications
13. Docker Registry: open source Docker image distribution
14. Docker Engine: creates and runs Docker containers
Docker Commands
● Attach Attach local standard input, output, and error streams to a running container
● Build Build an image from a Dockerfile
● Create Create a new container
● Deploy Deploy a new stack or update an existing stack
● Images List images
● Info Display system-wide information
● Kill Kill one or more running containers
● Load Load an image from a tar archive or STDIN
● Login Log in to a Docker registry
● Logout Log out from a Docker registry
● Logs Fetch the logs of a container
● Pause Pause all processes within one or more containers
● Port List port mappings or a specific mapping for the container
● Ps List containers
● Pull Pull an image or a repository from a registry
● Push Push an image or a repository to a registry
Docker Commands
● Rename Rename a container
● Restart Restart one or more containers
● Rm Remove one or more containers
● Rmi Remove one or more images
● Run Run a command in a new container
● Search Search the Docker Hub for images
● Start Start one or more stopped containers
● Stats Display a live stream of container(s) resource usage statistics
● Stop Stop one or more running containers
● Tag Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
● Top Display the running processes of a container
● Unpause Unpause all processes within one or more containers
● Update Update configuration of one or more containers
● Version Show the Docker version information
● Wait Block until one or more containers stop, then print their exit codes
Pull & Run Container
● docker pull nginx
● docker images
● docker run --name nginx -d -p 8080:80 nginx
● docker ps
● docker stop nginx
Build Docker Image
FROM ubuntu
MAINTAINER Ketan Parmar (ketanbparmar@yahoo.com)
RUN apt-get update
RUN apt-get install -y nginx
ENTRYPOINT [“/usr/sbin/nginx”,”-g”,”daemon off;”]
EXPOSE 80
● docker build -t mynginx:latest .
● docker images
● docker run --name mynginx -d -p 8080:80 nginx
Docker file commands
● ADD Copies a file from the host system onto the container
● CMD The command that runs when the container starts
● ENTRYPOINT
● ENV Sets an environment variable in the new container
● EXPOSE Opens a port for linked containers
● FROM The base image to use in the build. This is mandatory and must be the first command in the
file.
● MAINTAINER An optional value for the maintainer of the script
● ONBUILD A command that is triggered when the image in the Dcokerfile is used as a base for another
image
● RUN Executes a command and save the result as a new layer
● USER Sets the default user within the container
● VOLUME Creates a shared volume that can be shared among containers or by the host machine
● WORKDIR Set the default working directory for the container
Docker Compose
The answer to these questions is Docker
Compose, “a tool for defining and running
complex applications with Docker. With
Compose, you define a multi-container
application in a single file, then spin your
application up in a single command which does
everything that needs to be done to get it
running.”
Example
1 Redis container
3 Node containers
1 Nginx container
version: "3.3"
services:
nginx:
build: ./nginx
links:
- node1:node1
- node2:node2
- node3:node3
ports:
- "80:80"
node1:
build: ./node
links:
- redis
ports:
- "8080"
Docker Compose (docker-compose.yml)
node2:
build: ./node
links:
- redis
ports:
- "8080"
node3:
build: ./node
links:
- redis
ports:
- "8080"
redis:
image: redis
ports:
- "6379"
Top-level keys that define a section in the configuration file such as build, deploy, depends_on, networks, and so on, are
listed with the options that support them as sub-topics. This maps to the <key>: <option>: <value> indent structure of the
Compose file.
Services
Build
Command
Volumes
Ports
Networks
Dockerfile
ARG
Docker Compose (docker-compose.yml)
Build Build or rebuild services
Config Validate and view the Compose file
Create Create services
Down Stop and remove containers, networks, images, and volumes
Events Receive real time events from containers
Exec Execute a command in a running container
Help Get help on a command
Images List images
Kill Kill containers
Logs View output from containers
Pause Pause services
Port Print the public port for a port binding
Ps List containers
Pull Pull service images
Push Push service images
Restart Restart services
Rm Remove stopped containers
Run Run a one-off command
Scale Set number of containers for a service
Start Start services
Stop Stop services
Top Display the running processes
Unpause Unpause services
Up Create and start containers
Docker Compose CLI
Thank You

More Related Content

What's hot

containerd summit - Deep Dive into containerd
containerd summit - Deep Dive into containerdcontainerd summit - Deep Dive into containerd
containerd summit - Deep Dive into containerdDocker, Inc.
 
Containerd - core container runtime component
Containerd - core container runtime component Containerd - core container runtime component
Containerd - core container runtime component Docker, Inc.
 
Docker Birthday #3 - Intro to Docker Slides
Docker Birthday #3 - Intro to Docker SlidesDocker Birthday #3 - Intro to Docker Slides
Docker Birthday #3 - Intro to Docker SlidesDocker, Inc.
 
Introduction to Containers - From Docker to Kubernetes and everything in between
Introduction to Containers - From Docker to Kubernetes and everything in betweenIntroduction to Containers - From Docker to Kubernetes and everything in between
Introduction to Containers - From Docker to Kubernetes and everything in betweenAll Things Open
 
Introduction to Containers - SQL Server and Docker
Introduction to Containers - SQL Server and DockerIntroduction to Containers - SQL Server and Docker
Introduction to Containers - SQL Server and DockerChris Taylor
 
Developer workflow with docker
Developer workflow with dockerDeveloper workflow with docker
Developer workflow with dockerLalatendu Mohanty
 
Docker 101 - High level introduction to docker
Docker 101 - High level introduction to dockerDocker 101 - High level introduction to docker
Docker 101 - High level introduction to dockerDr Ganesh Iyer
 
All Things Containers - Docker, Kubernetes, Helm, Istio, GitOps and more
All Things Containers - Docker, Kubernetes, Helm, Istio, GitOps and moreAll Things Containers - Docker, Kubernetes, Helm, Istio, GitOps and more
All Things Containers - Docker, Kubernetes, Helm, Istio, GitOps and moreAll Things Open
 
Docker Platform 1.9
Docker Platform 1.9Docker Platform 1.9
Docker Platform 1.9Docker, Inc.
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to dockerJohn Willis
 
Wordcamp Bratislava 2017 - Docker! Why?
Wordcamp Bratislava 2017 - Docker! Why?Wordcamp Bratislava 2017 - Docker! Why?
Wordcamp Bratislava 2017 - Docker! Why?Adam Štipák
 
Docker 101: An Introduction
Docker 101: An IntroductionDocker 101: An Introduction
Docker 101: An IntroductionPOSSCON
 
LinuxKit Update at the Moby Summit
LinuxKit Update at the Moby SummitLinuxKit Update at the Moby Summit
LinuxKit Update at the Moby SummitDocker, Inc.
 
Monitoring Dell Infrastructure using Docker & Microservices
Monitoring Dell Infrastructure using Docker & MicroservicesMonitoring Dell Infrastructure using Docker & Microservices
Monitoring Dell Infrastructure using Docker & MicroservicesAjeet Singh Raina
 
Docker and the Linux Kernel
Docker and the Linux KernelDocker and the Linux Kernel
Docker and the Linux KernelDocker, Inc.
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker IntroductionRobert Reiz
 
LinuxKit: the first five months by Justin Cormack & Riyaz Faizullabhoy (Docker)
LinuxKit: the first five months by Justin Cormack & Riyaz Faizullabhoy (Docker)LinuxKit: the first five months by Justin Cormack & Riyaz Faizullabhoy (Docker)
LinuxKit: the first five months by Justin Cormack & Riyaz Faizullabhoy (Docker)Docker, Inc.
 
Introduction to LinuxKit - Docker Bangalore Meetup
Introduction to LinuxKit - Docker Bangalore MeetupIntroduction to LinuxKit - Docker Bangalore Meetup
Introduction to LinuxKit - Docker Bangalore MeetupAjeet Singh Raina
 

What's hot (20)

containerd summit - Deep Dive into containerd
containerd summit - Deep Dive into containerdcontainerd summit - Deep Dive into containerd
containerd summit - Deep Dive into containerd
 
Containerd - core container runtime component
Containerd - core container runtime component Containerd - core container runtime component
Containerd - core container runtime component
 
Docker Birthday #3 - Intro to Docker Slides
Docker Birthday #3 - Intro to Docker SlidesDocker Birthday #3 - Intro to Docker Slides
Docker Birthday #3 - Intro to Docker Slides
 
Introduction to Containers - From Docker to Kubernetes and everything in between
Introduction to Containers - From Docker to Kubernetes and everything in betweenIntroduction to Containers - From Docker to Kubernetes and everything in between
Introduction to Containers - From Docker to Kubernetes and everything in between
 
Introduction to Containers - SQL Server and Docker
Introduction to Containers - SQL Server and DockerIntroduction to Containers - SQL Server and Docker
Introduction to Containers - SQL Server and Docker
 
Developer workflow with docker
Developer workflow with dockerDeveloper workflow with docker
Developer workflow with docker
 
Docker 101 Checonf 2016
Docker 101 Checonf 2016Docker 101 Checonf 2016
Docker 101 Checonf 2016
 
Docker 101 - High level introduction to docker
Docker 101 - High level introduction to dockerDocker 101 - High level introduction to docker
Docker 101 - High level introduction to docker
 
All Things Containers - Docker, Kubernetes, Helm, Istio, GitOps and more
All Things Containers - Docker, Kubernetes, Helm, Istio, GitOps and moreAll Things Containers - Docker, Kubernetes, Helm, Istio, GitOps and more
All Things Containers - Docker, Kubernetes, Helm, Istio, GitOps and more
 
Docker Platform 1.9
Docker Platform 1.9Docker Platform 1.9
Docker Platform 1.9
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
Wordcamp Bratislava 2017 - Docker! Why?
Wordcamp Bratislava 2017 - Docker! Why?Wordcamp Bratislava 2017 - Docker! Why?
Wordcamp Bratislava 2017 - Docker! Why?
 
Docker 101: An Introduction
Docker 101: An IntroductionDocker 101: An Introduction
Docker 101: An Introduction
 
LinuxKit Update at the Moby Summit
LinuxKit Update at the Moby SummitLinuxKit Update at the Moby Summit
LinuxKit Update at the Moby Summit
 
Monitoring Dell Infrastructure using Docker & Microservices
Monitoring Dell Infrastructure using Docker & MicroservicesMonitoring Dell Infrastructure using Docker & Microservices
Monitoring Dell Infrastructure using Docker & Microservices
 
Docker and the Linux Kernel
Docker and the Linux KernelDocker and the Linux Kernel
Docker and the Linux Kernel
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
LinuxKit: the first five months by Justin Cormack & Riyaz Faizullabhoy (Docker)
LinuxKit: the first five months by Justin Cormack & Riyaz Faizullabhoy (Docker)LinuxKit: the first five months by Justin Cormack & Riyaz Faizullabhoy (Docker)
LinuxKit: the first five months by Justin Cormack & Riyaz Faizullabhoy (Docker)
 
Intro to docker
Intro to dockerIntro to docker
Intro to docker
 
Introduction to LinuxKit - Docker Bangalore Meetup
Introduction to LinuxKit - Docker Bangalore MeetupIntroduction to LinuxKit - Docker Bangalore Meetup
Introduction to LinuxKit - Docker Bangalore Meetup
 

Similar to Introduction of Docker and Docker Compose

Powercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptxPowercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptxIgnacioTamayo2
 
Introduction to Docker and Monitoring with InfluxData
Introduction to Docker and Monitoring with InfluxDataIntroduction to Docker and Monitoring with InfluxData
Introduction to Docker and Monitoring with InfluxDataInfluxData
 
Best Practices for Developing & Deploying Java Applications with Docker
Best Practices for Developing & Deploying Java Applications with DockerBest Practices for Developing & Deploying Java Applications with Docker
Best Practices for Developing & Deploying Java Applications with DockerEric Smalling
 
Docker Essentials Workshop— Innovation Labs July 2020
Docker Essentials Workshop— Innovation Labs July 2020Docker Essentials Workshop— Innovation Labs July 2020
Docker Essentials Workshop— Innovation Labs July 2020CloudHero
 
Docker up and Running For Web Developers
Docker up and Running For Web DevelopersDocker up and Running For Web Developers
Docker up and Running For Web DevelopersBADR
 
Docker Up and Running for Web Developers
Docker Up and Running for Web DevelopersDocker Up and Running for Web Developers
Docker Up and Running for Web DevelopersAmr Fawzy
 
Docker primer and tips
Docker primer and tipsDocker primer and tips
Docker primer and tipsSamuel Chow
 
Docker workshop 0507 Taichung
Docker workshop 0507 Taichung Docker workshop 0507 Taichung
Docker workshop 0507 Taichung Paul Chao
 
手把手帶你學 Docker 入門篇
手把手帶你學 Docker 入門篇手把手帶你學 Docker 入門篇
手把手帶你學 Docker 入門篇Philip Zheng
 
14309525_docker_docker_docker_docker_introduction.ppt
14309525_docker_docker_docker_docker_introduction.ppt14309525_docker_docker_docker_docker_introduction.ppt
14309525_docker_docker_docker_docker_introduction.pptaravym456
 
[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101Naukri.com
 
Running the Oracle SOA Suite Environment in a Docker Container
Running the Oracle SOA Suite Environment in a Docker ContainerRunning the Oracle SOA Suite Environment in a Docker Container
Running the Oracle SOA Suite Environment in a Docker ContainerGuido Schmutz
 
PuppetConf 2017: What’s in the Box?!- Leveraging Puppet Enterprise & Docker- ...
PuppetConf 2017: What’s in the Box?!- Leveraging Puppet Enterprise & Docker- ...PuppetConf 2017: What’s in the Box?!- Leveraging Puppet Enterprise & Docker- ...
PuppetConf 2017: What’s in the Box?!- Leveraging Puppet Enterprise & Docker- ...Puppet
 

Similar to Introduction of Docker and Docker Compose (20)

Powercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptxPowercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptx
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Introduction to Docker and Monitoring with InfluxData
Introduction to Docker and Monitoring with InfluxDataIntroduction to Docker and Monitoring with InfluxData
Introduction to Docker and Monitoring with InfluxData
 
Best Practices for Developing & Deploying Java Applications with Docker
Best Practices for Developing & Deploying Java Applications with DockerBest Practices for Developing & Deploying Java Applications with Docker
Best Practices for Developing & Deploying Java Applications with Docker
 
Docker Essentials Workshop— Innovation Labs July 2020
Docker Essentials Workshop— Innovation Labs July 2020Docker Essentials Workshop— Innovation Labs July 2020
Docker Essentials Workshop— Innovation Labs July 2020
 
Docker up and Running For Web Developers
Docker up and Running For Web DevelopersDocker up and Running For Web Developers
Docker up and Running For Web Developers
 
Docker Up and Running for Web Developers
Docker Up and Running for Web DevelopersDocker Up and Running for Web Developers
Docker Up and Running for Web Developers
 
Docker primer and tips
Docker primer and tipsDocker primer and tips
Docker primer and tips
 
DockerCC.pdf
DockerCC.pdfDockerCC.pdf
DockerCC.pdf
 
Docker workshop 0507 Taichung
Docker workshop 0507 Taichung Docker workshop 0507 Taichung
Docker workshop 0507 Taichung
 
手把手帶你學 Docker 入門篇
手把手帶你學 Docker 入門篇手把手帶你學 Docker 入門篇
手把手帶你學 Docker 入門篇
 
Docker, LinuX Container
Docker, LinuX ContainerDocker, LinuX Container
Docker, LinuX Container
 
14309525_docker_docker_docker_docker_introduction.ppt
14309525_docker_docker_docker_docker_introduction.ppt14309525_docker_docker_docker_docker_introduction.ppt
14309525_docker_docker_docker_docker_introduction.ppt
 
Docker.pdf
Docker.pdfDocker.pdf
Docker.pdf
 
[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101
 
How to _docker
How to _dockerHow to _docker
How to _docker
 
Docker+java
Docker+javaDocker+java
Docker+java
 
Running the Oracle SOA Suite Environment in a Docker Container
Running the Oracle SOA Suite Environment in a Docker ContainerRunning the Oracle SOA Suite Environment in a Docker Container
Running the Oracle SOA Suite Environment in a Docker Container
 
PuppetConf 2017: What’s in the Box?!- Leveraging Puppet Enterprise & Docker- ...
PuppetConf 2017: What’s in the Box?!- Leveraging Puppet Enterprise & Docker- ...PuppetConf 2017: What’s in the Box?!- Leveraging Puppet Enterprise & Docker- ...
PuppetConf 2017: What’s in the Box?!- Leveraging Puppet Enterprise & Docker- ...
 
Docker Basics
Docker BasicsDocker Basics
Docker Basics
 

Recently uploaded

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 

Recently uploaded (20)

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 

Introduction of Docker and Docker Compose

  • 1. Introduction - Docker & Docker Compose Docker Ahmedabad Meetup
  • 2. About Me Ketan Parmar ● Education: Ph.D Computer Science (Grid Computing) ● Experience: 10 years ● Twitter: @kpbird ● LinkedIn: https://www.linkedin.com/in/kpbird/ ● Books Review: ○ Mastering AWS Development ○ Developing RESTful Web Services with Jersey 2.0
  • 3. History 1. Session Based Computing 2. Non-Session Based Computing (eg. VDI or VM) 3. Containers
  • 4. Why Containers? 1. Simplifying Configuration 2. Code Pipeline Management 3. Developer Productivity 4. App Isolation 5. Server Consolidation 6. Debugging Capabilities 7. And more..
  • 7. TERMINOLOGY 1. Docker client: command line that can be installed on Mac OS X or Windows to control most of the Docker workflow and talk to Docker servers 2. Docker server: Docker running in daemon mode on a Linux server. The servers starts, runs, and stops/destroys containers. 3. Docker images: layered filesystems described via metadata that represent all the dependencies necessary to run an application. 4. Docker repository: the library of available Docker images, can be public (Docker Hub) or private 5. Docker container: a single instance of a Linux container built from the Docker image. There can be many containers built from a single Docker image. 6. Docker host: the underlying Linux operating system that hosts the Docker daemon 7. Docker Hub: public repository of Docker images 8. Docker Trusted Registry: private image repository 9. Docker Toolbox: specialized installer for Docker tools on Mac and Windows 10. Docker Machine: automated Docker provisioning 11. Docker Swarm: host clustering and container scheduling 12. Docker Compose: define multi-container applications 13. Docker Registry: open source Docker image distribution 14. Docker Engine: creates and runs Docker containers
  • 8. Docker Commands ● Attach Attach local standard input, output, and error streams to a running container ● Build Build an image from a Dockerfile ● Create Create a new container ● Deploy Deploy a new stack or update an existing stack ● Images List images ● Info Display system-wide information ● Kill Kill one or more running containers ● Load Load an image from a tar archive or STDIN ● Login Log in to a Docker registry ● Logout Log out from a Docker registry ● Logs Fetch the logs of a container ● Pause Pause all processes within one or more containers ● Port List port mappings or a specific mapping for the container ● Ps List containers ● Pull Pull an image or a repository from a registry ● Push Push an image or a repository to a registry
  • 9. Docker Commands ● Rename Rename a container ● Restart Restart one or more containers ● Rm Remove one or more containers ● Rmi Remove one or more images ● Run Run a command in a new container ● Search Search the Docker Hub for images ● Start Start one or more stopped containers ● Stats Display a live stream of container(s) resource usage statistics ● Stop Stop one or more running containers ● Tag Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE ● Top Display the running processes of a container ● Unpause Unpause all processes within one or more containers ● Update Update configuration of one or more containers ● Version Show the Docker version information ● Wait Block until one or more containers stop, then print their exit codes
  • 10. Pull & Run Container ● docker pull nginx ● docker images ● docker run --name nginx -d -p 8080:80 nginx ● docker ps ● docker stop nginx
  • 11. Build Docker Image FROM ubuntu MAINTAINER Ketan Parmar (ketanbparmar@yahoo.com) RUN apt-get update RUN apt-get install -y nginx ENTRYPOINT [“/usr/sbin/nginx”,”-g”,”daemon off;”] EXPOSE 80 ● docker build -t mynginx:latest . ● docker images ● docker run --name mynginx -d -p 8080:80 nginx
  • 12. Docker file commands ● ADD Copies a file from the host system onto the container ● CMD The command that runs when the container starts ● ENTRYPOINT ● ENV Sets an environment variable in the new container ● EXPOSE Opens a port for linked containers ● FROM The base image to use in the build. This is mandatory and must be the first command in the file. ● MAINTAINER An optional value for the maintainer of the script ● ONBUILD A command that is triggered when the image in the Dcokerfile is used as a base for another image ● RUN Executes a command and save the result as a new layer ● USER Sets the default user within the container ● VOLUME Creates a shared volume that can be shared among containers or by the host machine ● WORKDIR Set the default working directory for the container
  • 13. Docker Compose The answer to these questions is Docker Compose, “a tool for defining and running complex applications with Docker. With Compose, you define a multi-container application in a single file, then spin your application up in a single command which does everything that needs to be done to get it running.” Example 1 Redis container 3 Node containers 1 Nginx container
  • 14. version: "3.3" services: nginx: build: ./nginx links: - node1:node1 - node2:node2 - node3:node3 ports: - "80:80" node1: build: ./node links: - redis ports: - "8080" Docker Compose (docker-compose.yml) node2: build: ./node links: - redis ports: - "8080" node3: build: ./node links: - redis ports: - "8080" redis: image: redis ports: - "6379"
  • 15. Top-level keys that define a section in the configuration file such as build, deploy, depends_on, networks, and so on, are listed with the options that support them as sub-topics. This maps to the <key>: <option>: <value> indent structure of the Compose file. Services Build Command Volumes Ports Networks Dockerfile ARG Docker Compose (docker-compose.yml)
  • 16. Build Build or rebuild services Config Validate and view the Compose file Create Create services Down Stop and remove containers, networks, images, and volumes Events Receive real time events from containers Exec Execute a command in a running container Help Get help on a command Images List images Kill Kill containers Logs View output from containers Pause Pause services Port Print the public port for a port binding Ps List containers Pull Pull service images Push Push service images Restart Restart services Rm Remove stopped containers Run Run a one-off command Scale Set number of containers for a service Start Start services Stop Stop services Top Display the running processes Unpause Unpause services Up Create and start containers Docker Compose CLI