SlideShare a Scribd company logo
1 of 40
Download to read offline
Docker, but what it is?
Introduction to Docker and its ecosystem
Who am I?
• Julien Maitrehenry
• DevOps, Cloud Architect, Developer
• Co-founder @Kumojin
• Kumojin.com
• Github.com/jmaitrehenry
• jmaitrehenry.ca
Agenda
• What is Docker?
• Docker Compose
• Orchestration
• Docker Desktop
• Questions?
Photo by Ian Taylor on Unsplash
What is
Docker?
But what
does
« Docker »
mean?
• An Open Source project and community
• Tools from this project
• A company: Docker inc.
And what is
it for?
At the beginning
• One goal
• Linux only
• Intel CPU only
• A big and fat binnary
And now?
• Linux and Windows containers
• Running on Mac, Windows and Linux
• Multi Architecture (intel, armv5-8, ppc, i386)
• Split into many components
• Component standardisation (OCI, CNCF)
• Adopted by a large majority of cloud
providers
What is a container?
• An isolated space where an application run
• Contain everything needed to run the
application (libs, binaries, etc.)
• Own its dedicated network stack, users,
process, etc.
• Share the host kernel
• Could have some resource restriction (CPU,
Ram, etc.)
How is it different from a VM?
How to
create a
container?
What is an
image?
• An union of layers
• Each layers are immutable
• Each layers are reusable
Let’s build a Docker image
Base image
Environnent variable
Variable set during build
Working directory
Copy files into image
Command executed during build
Copy folder into image
Default command that will be
executed during a docker run
How to transform our file into an image?
❯ docker build -t myapp:v1.0.0 --build-arg NODE_ENV=development .
Command to build an image
Give a name and tag to the image
Set a build variable
Build context
If the Dockerfile file has another name or is located elsewhere, it must be specified with:
-f .docker/Dockerfile
Warning : the context build is always the last parameter
How to run a container?
- I can’t access my app from my browser
- Ctr+C do not stop my app
- The container name will be randomly generated - ex: goofy_kapitsa
❯ docker run myapp:v1.0.0
Command to run a container Image name and tag
How to run a container?
❯ docker run –ti -p 8080:80 --name myapp myapp:v1.0.0
Run in interactive mode and with a tty
Link container port 80 to host port 8080
Give the name myapp to the container
How to run a container?
❯ docker run –d -p 8080:80 --name myapp myapp:v1.0.0
Run container in background
❯ docker run –ti –p 8080:80 --name myapp --rm myapp:v1.0.0 bash
Automatically remove the container when stopped
Change the default command (CMD)
Summary
Docker Engine
• Client-Server application for managing
• Images
• Containers
• Networks
• Volumes
• Has a REST API and a CLI
Volume
• Keep data outside the container
• Share data with host
This Photo by Unknown Author is licensed under CC BY-SA-NC
Share folder/files between host and container
❯ docker run -ti --rm -v `pwd`/mydir:/data ubuntu
Command for using a volume
Local directory on host Directory in the container
Be careful when mounting a file!
Changes to file may not be reflected in container
Ex: sed, vim, VS Code
Using a volume
❯ docker volume create mydata
❯ docker run -ti --rm -v mydata:/data ubuntu
Command to manage volume Volume name
Volume name instead of a path
Network
• Allows you to:
• create isolated network
• Reproduce production network topology
• Container can communicate with each other
using by name, id or alias
• Many network type/driver available:
• Bridge (default)
• Internal
• None
• Host
Internal network
❯ docker network create --internal intnet
❯ docker run --network intnet curlimages/curl -m3 https://google.com
╰─❯ curl: (28) Resolving timed out after 3002 milliseconds
Command to manage networks Network type Network name
Attach the container to the intent network
Intra-container communication
❯ docker network create --driver bridge mynet
❯ docker run -d --network mynet --name nginx --network-alias web nginx
❯ docker run --rm --network mynet curlimages/curl -m3 http://web
Use a specific network driver
Adds an alias to the container in networks it is connected
Container name or ID also works
Other useful network
❯ docker run --rm --network none curl -m3 https://google.com
❯ docker run –d --network host nginx
No network isolation between host and container
Without network
Docker
Compose
Let’s build a docker compose file
DEPRECATED - No more used
Services definition
Networks definition
Volumes definition
Let’s build a docker compose file
Service name and its name on the network
Container image
If the container crash, docker will restart it
List of volumes to attach to the container
List of environment variables
List of networks to attach to the container
Let’s build a docker compose file
Override default image command
You can attach a volume to a directory in another volume
Definition for building the image
Create a dependency on another service
List of port to link to the host
Let’s build a docker compose file
On a separate network from the database
How to use a compose file?
❯ docker compose ps -a
List the containers created by compose Including those stopped
❯ docker compose logs -f [name of service(s)]
Show logs And show new logs as they come
❯ docker compose up –d [name of service(s)]
Command for compose Start service(s)
In background
Registry Docker
• Hosts Docker Images
• Many online registry available:
• Docker Hub
• Azure ACR
• AWS ECR
• Github Registry
• …
• Many self-hosted solutions:
• Docker Registry
• Nexus
• Artifactory
• …
Useful commands
❯ docker login / docker login kumojin.azurecr.io
Connect Docker to a registry
Pull an image locally
Push a local image to a registry
❯ docker push jmaitrehenry/myimage
❯ docker pull kumojin.azurecr.io/myapp/api:v1.0.0
Connect to a specific registry
Orchestration
• For what?
• Orchestration tools
• Cloud solutions
For what?
• Container supply and placement
• Health check mechanism and metrics
• Unavailability and scalability management
• Deployment management
• Service discovery and network management
• And more!
Orchestration tools
Cloud
Solutions
• Kubernetes based
• Azure: AKS
• AWS: EKS
• Google: GKE
• Container based
• Azure ACI
• AWS Fargate
• AWS ECS
Docker
Desktop
What is it?
For what?
Questions?

More Related Content

What's hot

What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...
What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...
What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...
Simplilearn
 
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
dotCloud
 
Docker Compose by Aanand Prasad
Docker Compose by Aanand Prasad Docker Compose by Aanand Prasad
Docker Compose by Aanand Prasad
Docker, Inc.
 

What's hot (20)

Docker introduction for the beginners
Docker introduction for the beginnersDocker introduction for the beginners
Docker introduction for the beginners
 
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...
 
Docker Introduction.pdf
Docker Introduction.pdfDocker Introduction.pdf
Docker Introduction.pdf
 
Docker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutesDocker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutes
 
DCEU 18: Dockerfile Best Practices
DCEU 18: Dockerfile Best PracticesDCEU 18: Dockerfile Best Practices
DCEU 18: Dockerfile Best Practices
 
Docker Swarm for Beginner
Docker Swarm for BeginnerDocker Swarm for Beginner
Docker Swarm for Beginner
 
From Zero to Docker
From Zero to DockerFrom Zero to Docker
From Zero to Docker
 
Docker 101: An Introduction
Docker 101: An IntroductionDocker 101: An Introduction
Docker 101: An Introduction
 
A Gentle Introduction To Docker And All Things Containers
A Gentle Introduction To Docker And All Things ContainersA Gentle Introduction To Docker And All Things Containers
A Gentle Introduction To Docker And All Things Containers
 
Containerization and Docker
Containerization and DockerContainerization and Docker
Containerization and Docker
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
What is Docker
What is DockerWhat is Docker
What is Docker
 
What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...
What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...
What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
Dockers and containers basics
Dockers and containers basicsDockers and containers basics
Dockers and containers basics
 
Docker Compose by Aanand Prasad
Docker Compose by Aanand Prasad Docker Compose by Aanand Prasad
Docker Compose by Aanand Prasad
 
Docker introduction (1)
Docker introduction (1)Docker introduction (1)
Docker introduction (1)
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 

Similar to Docker, but what it is?

Dockers Containers in action Slide 0 to hero
Dockers Containers in action Slide  0 to heroDockers Containers in action Slide  0 to hero
Dockers Containers in action Slide 0 to hero
TayyabAslam24
 

Similar to Docker, but what it is? (20)

Docker From Scratch
Docker From ScratchDocker From Scratch
Docker From Scratch
 
Docker - From Walking To Running
Docker - From Walking To RunningDocker - From Walking To Running
Docker - From Walking To Running
 
Powercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptxPowercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptx
 
moscmy2016: Extending Docker
moscmy2016: Extending Dockermoscmy2016: Extending Docker
moscmy2016: Extending Docker
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Docker Ecosystem on Azure
Docker Ecosystem on AzureDocker Ecosystem on Azure
Docker Ecosystem on Azure
 
Up and running with docker
Up and running with dockerUp and running with docker
Up and running with docker
 
Tech talk on docker with demo
Tech talk on docker with demoTech talk on docker with demo
Tech talk on docker with demo
 
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
 
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
 
Getting Started with Docker
Getting Started with DockerGetting Started with Docker
Getting Started with Docker
 
ABCs of docker
ABCs of dockerABCs of docker
ABCs of docker
 
Intro docker and demo monitor on docker
Intro docker and demo monitor on dockerIntro docker and demo monitor on docker
Intro docker and demo monitor on docker
 
Containerization using docker and its applications
Containerization using docker and its applicationsContainerization using docker and its applications
Containerization using docker and its applications
 
Containerization using docker and its applications
Containerization using docker and its applicationsContainerization using docker and its applications
Containerization using docker and its applications
 
Dockers Containers in action Slide 0 to hero
Dockers Containers in action Slide  0 to heroDockers Containers in action Slide  0 to hero
Dockers Containers in action Slide 0 to hero
 
Docker DANS workshop
Docker DANS workshopDocker DANS workshop
Docker DANS workshop
 
Docker, LinuX Container
Docker, LinuX ContainerDocker, LinuX Container
Docker, LinuX Container
 
Docker 101 - Zaragoza Docker Meetup - Universidad de Zaragoza
Docker 101 - Zaragoza Docker Meetup - Universidad de ZaragozaDocker 101 - Zaragoza Docker Meetup - Universidad de Zaragoza
Docker 101 - Zaragoza Docker Meetup - Universidad de Zaragoza
 
Docker for developers z java
Docker for developers z javaDocker for developers z java
Docker for developers z java
 

More from Julien Maitrehenry

Fullstack monitoring - Overview
Fullstack monitoring - OverviewFullstack monitoring - Overview
Fullstack monitoring - Overview
Julien Maitrehenry
 

More from Julien Maitrehenry (12)

Docker, mais qu’est-ce que c’est ?
Docker, mais qu’est-ce que c’est ?Docker, mais qu’est-ce que c’est ?
Docker, mais qu’est-ce que c’est ?
 
A la découverte de kubernetes
A la découverte de kubernetesA la découverte de kubernetes
A la découverte de kubernetes
 
Comment maitriser git et produire de beaux commits
Comment maitriser git et produire de beaux commitsComment maitriser git et produire de beaux commits
Comment maitriser git et produire de beaux commits
 
Global Azure Bootcamp Québec - Container on Azure
Global Azure Bootcamp Québec - Container on AzureGlobal Azure Bootcamp Québec - Container on Azure
Global Azure Bootcamp Québec - Container on Azure
 
Build a Docker Swarm cluster on Azure
Build a Docker Swarm cluster on Azure Build a Docker Swarm cluster on Azure
Build a Docker Swarm cluster on Azure
 
Retour d'expérience sur notre stack de log
Retour d'expérience sur notre stack de logRetour d'expérience sur notre stack de log
Retour d'expérience sur notre stack de log
 
Docker, ça mange quoi au printemps
Docker, ça mange quoi au printempsDocker, ça mange quoi au printemps
Docker, ça mange quoi au printemps
 
Code, ship and run
Code, ship and runCode, ship and run
Code, ship and run
 
Sécuriser Docker - Utilisation du CIS Docker 1.12 by @guytalbot
Sécuriser Docker - Utilisation du CIS Docker 1.12 by @guytalbotSécuriser Docker - Utilisation du CIS Docker 1.12 by @guytalbot
Sécuriser Docker - Utilisation du CIS Docker 1.12 by @guytalbot
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
Fullstack monitoring - Overview
Fullstack monitoring - OverviewFullstack monitoring - Overview
Fullstack monitoring - Overview
 
Docker cluster with swarm, consul, registrator and consul-template
Docker cluster with swarm, consul, registrator and consul-templateDocker cluster with swarm, consul, registrator and consul-template
Docker cluster with swarm, consul, registrator and consul-template
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
+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...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
+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...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
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
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
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)
 

Docker, but what it is?

  • 1. Docker, but what it is? Introduction to Docker and its ecosystem
  • 2. Who am I? • Julien Maitrehenry • DevOps, Cloud Architect, Developer • Co-founder @Kumojin • Kumojin.com • Github.com/jmaitrehenry • jmaitrehenry.ca
  • 3. Agenda • What is Docker? • Docker Compose • Orchestration • Docker Desktop • Questions? Photo by Ian Taylor on Unsplash
  • 5. But what does « Docker » mean? • An Open Source project and community • Tools from this project • A company: Docker inc.
  • 7. At the beginning • One goal • Linux only • Intel CPU only • A big and fat binnary
  • 8. And now? • Linux and Windows containers • Running on Mac, Windows and Linux • Multi Architecture (intel, armv5-8, ppc, i386) • Split into many components • Component standardisation (OCI, CNCF) • Adopted by a large majority of cloud providers
  • 9. What is a container? • An isolated space where an application run • Contain everything needed to run the application (libs, binaries, etc.) • Own its dedicated network stack, users, process, etc. • Share the host kernel • Could have some resource restriction (CPU, Ram, etc.)
  • 10. How is it different from a VM?
  • 12. What is an image? • An union of layers • Each layers are immutable • Each layers are reusable
  • 13. Let’s build a Docker image Base image Environnent variable Variable set during build Working directory Copy files into image Command executed during build Copy folder into image Default command that will be executed during a docker run
  • 14. How to transform our file into an image? ❯ docker build -t myapp:v1.0.0 --build-arg NODE_ENV=development . Command to build an image Give a name and tag to the image Set a build variable Build context If the Dockerfile file has another name or is located elsewhere, it must be specified with: -f .docker/Dockerfile Warning : the context build is always the last parameter
  • 15. How to run a container? - I can’t access my app from my browser - Ctr+C do not stop my app - The container name will be randomly generated - ex: goofy_kapitsa ❯ docker run myapp:v1.0.0 Command to run a container Image name and tag
  • 16. How to run a container? ❯ docker run –ti -p 8080:80 --name myapp myapp:v1.0.0 Run in interactive mode and with a tty Link container port 80 to host port 8080 Give the name myapp to the container
  • 17. How to run a container? ❯ docker run –d -p 8080:80 --name myapp myapp:v1.0.0 Run container in background ❯ docker run –ti –p 8080:80 --name myapp --rm myapp:v1.0.0 bash Automatically remove the container when stopped Change the default command (CMD)
  • 19. Docker Engine • Client-Server application for managing • Images • Containers • Networks • Volumes • Has a REST API and a CLI
  • 20. Volume • Keep data outside the container • Share data with host This Photo by Unknown Author is licensed under CC BY-SA-NC
  • 21. Share folder/files between host and container ❯ docker run -ti --rm -v `pwd`/mydir:/data ubuntu Command for using a volume Local directory on host Directory in the container Be careful when mounting a file! Changes to file may not be reflected in container Ex: sed, vim, VS Code
  • 22. Using a volume ❯ docker volume create mydata ❯ docker run -ti --rm -v mydata:/data ubuntu Command to manage volume Volume name Volume name instead of a path
  • 23. Network • Allows you to: • create isolated network • Reproduce production network topology • Container can communicate with each other using by name, id or alias • Many network type/driver available: • Bridge (default) • Internal • None • Host
  • 24. Internal network ❯ docker network create --internal intnet ❯ docker run --network intnet curlimages/curl -m3 https://google.com ╰─❯ curl: (28) Resolving timed out after 3002 milliseconds Command to manage networks Network type Network name Attach the container to the intent network
  • 25. Intra-container communication ❯ docker network create --driver bridge mynet ❯ docker run -d --network mynet --name nginx --network-alias web nginx ❯ docker run --rm --network mynet curlimages/curl -m3 http://web Use a specific network driver Adds an alias to the container in networks it is connected Container name or ID also works
  • 26. Other useful network ❯ docker run --rm --network none curl -m3 https://google.com ❯ docker run –d --network host nginx No network isolation between host and container Without network
  • 28. Let’s build a docker compose file DEPRECATED - No more used Services definition Networks definition Volumes definition
  • 29. Let’s build a docker compose file Service name and its name on the network Container image If the container crash, docker will restart it List of volumes to attach to the container List of environment variables List of networks to attach to the container
  • 30. Let’s build a docker compose file Override default image command You can attach a volume to a directory in another volume Definition for building the image Create a dependency on another service List of port to link to the host
  • 31. Let’s build a docker compose file On a separate network from the database
  • 32. How to use a compose file? ❯ docker compose ps -a List the containers created by compose Including those stopped ❯ docker compose logs -f [name of service(s)] Show logs And show new logs as they come ❯ docker compose up –d [name of service(s)] Command for compose Start service(s) In background
  • 33. Registry Docker • Hosts Docker Images • Many online registry available: • Docker Hub • Azure ACR • AWS ECR • Github Registry • … • Many self-hosted solutions: • Docker Registry • Nexus • Artifactory • …
  • 34. Useful commands ❯ docker login / docker login kumojin.azurecr.io Connect Docker to a registry Pull an image locally Push a local image to a registry ❯ docker push jmaitrehenry/myimage ❯ docker pull kumojin.azurecr.io/myapp/api:v1.0.0 Connect to a specific registry
  • 35. Orchestration • For what? • Orchestration tools • Cloud solutions
  • 36. For what? • Container supply and placement • Health check mechanism and metrics • Unavailability and scalability management • Deployment management • Service discovery and network management • And more!
  • 38. Cloud Solutions • Kubernetes based • Azure: AKS • AWS: EKS • Google: GKE • Container based • Azure ACI • AWS Fargate • AWS ECS