SlideShare a Scribd company logo
1 of 25
Download to read offline
Docker 101
What's Docker and How to use?
version: 2
Agenda
● What is Docker?
● What is the difference from virtualization?
● Why do we need Docker?
● Container, Image and Layer
● Examples
● Best My Practices
● Discussion
What is Docker?
Docker is a container management service
When you develop an application, you need to provide your code
alongside with all possible dependencies like libraries, web server,
databases, etc. You may end up in a situation when the application is
working on your computer but won’t even start on stage env., dev env.
or a QA’s machine.
This challenge can be addressed by isolating the app to make it
independent of the system.
Package software into standardized units
for development, shipment and deployment
Containers isolate software from its
surroundings, for example
differences between development
and staging environments and help
reduce conflicts between teams
running different software on the
same infrastructure.
What is the difference from
virtualization?
Comparing Containers and Virtual Machines
Containers and Virtual Machines Together
Why do we need Docker?
The list of benefits is the following
● Faster development process.
There is no need to install 3rd parties like PostgreSQL, Redis,
Elasticsearch. Those can be run in containers.
● Handy application encapsulation (you can deliver your application in one
piece).
● Same behaviour on local machine / dev / stage / production servers.
● Easy and clear monitoring.
● Easy to scale (if you’ve done your application right it will be ready to
scaling not only in Docker).
Examples
Live Demo
1. Hello world
2. Nginx
3. Writing Dockerfile
4. *Docker Compose
a. Python + Redis
b. Wordpress
Container, Image and Layer
Dockerfile Mapping
FROM ubuntu:15.04
COPY . /app
RUN make /app
CMD python /app/app.py
Container, Image and Layer
FROM ubuntu:15.04
COPY . /app
RUN make /app
CMD python /app/app.py
Best My Practices
Create Images
● Include only necessary context — use a .dockerignore file (like .gitignore in git)
● Avoid installing unnecessary packages — it will consume extra disk space
● Use cache. Add context which changes a lot (for example source code of your
project) at the end of Dockerfile — it will utilize Docker cache effectively.
● Be careful with volumes. You should remember what data is in volumes. Because
volumes are persistent and don’t die with the containers - next container will use
data from volume which was created by previous container.
● Use environment variables (in RUN, EXPOSE, VOLUME). It will make your Dockerfile
more flexible.
● Use multi-stage builds to reduce image size(Docker 17.05 above)
Container Tips
● 1 application = 1 container
● Run process in foreground (don't use systemd, upstart or any other similar
tools)
● Keep data out of container — use volumes
● Do not use SSH (if you need to step into container you can use docker
execcommand)
● Avoid manual configurations (or actions) inside container
Discussion
What is Docker
means to you?
Why do you need
Docker?
How will you use
Docker?
Thanks!
HC Lo
Reference
● What is Docker and How to Use it With Python (Tutorial)
● Docker Documentation
● Docker 入門與實戰
● Docker 容器與容器雲
● Examples

More Related Content

What's hot

Google ko: fast Kubernetes microservice development in Go - Sangam Biradar, E...
Google ko: fast Kubernetes microservice development in Go - Sangam Biradar, E...Google ko: fast Kubernetes microservice development in Go - Sangam Biradar, E...
Google ko: fast Kubernetes microservice development in Go - Sangam Biradar, E...sangam biradar
 
Docker for local development
Docker for local developmentDocker for local development
Docker for local developmentAdam Štipák
 
Docker from a team perspective
Docker from a team perspectiveDocker from a team perspective
Docker from a team perspectiveEdwin Vlieg
 
AllTheTalks 2020: Buildpacks - container for everyone!
AllTheTalks 2020: Buildpacks - container for everyone!AllTheTalks 2020: Buildpacks - container for everyone!
AllTheTalks 2020: Buildpacks - container for everyone!Zander Mackie
 
Dockerfiles & Best Practices
Dockerfiles & Best PracticesDockerfiles & Best Practices
Dockerfiles & Best PracticesAvash Mulmi
 
Docker at MoneyBird
Docker at MoneyBirdDocker at MoneyBird
Docker at MoneyBirdEdwin Vlieg
 
from docker run to docker compose (Webelement #36)
from docker run to docker compose (Webelement #36)from docker run to docker compose (Webelement #36)
from docker run to docker compose (Webelement #36)Adam Štipák
 
Boston Code Dojo - Docker meetup slides
Boston Code Dojo - Docker meetup slidesBoston Code Dojo - Docker meetup slides
Boston Code Dojo - Docker meetup slidesCalvin Froedge
 
Introduction to Docker for NodeJs developers at Node DC 2/26/2014
Introduction to Docker for NodeJs developers at Node DC 2/26/2014Introduction to Docker for NodeJs developers at Node DC 2/26/2014
Introduction to Docker for NodeJs developers at Node DC 2/26/2014lenworthhenry
 
Docker + Tenserflow + GOlang - Golang singapore Meetup
Docker + Tenserflow + GOlang - Golang singapore MeetupDocker + Tenserflow + GOlang - Golang singapore Meetup
Docker + Tenserflow + GOlang - Golang singapore Meetupsangam biradar
 
Introducing docker
Introducing dockerIntroducing docker
Introducing dockerDharmit Shah
 
Docker session I: Continuous integration, delivery and deployment
Docker session I: Continuous integration, delivery and deploymentDocker session I: Continuous integration, delivery and deployment
Docker session I: Continuous integration, delivery and deploymentDegendra Sivakoti
 
Building CLI Applications with Golang
Building CLI Applications with GolangBuilding CLI Applications with Golang
Building CLI Applications with GolangAnshul Patel
 

What's hot (20)

Google ko: fast Kubernetes microservice development in Go - Sangam Biradar, E...
Google ko: fast Kubernetes microservice development in Go - Sangam Biradar, E...Google ko: fast Kubernetes microservice development in Go - Sangam Biradar, E...
Google ko: fast Kubernetes microservice development in Go - Sangam Biradar, E...
 
Docker for local development
Docker for local developmentDocker for local development
Docker for local development
 
Docker in Production
Docker in ProductionDocker in Production
Docker in Production
 
Docker from a team perspective
Docker from a team perspectiveDocker from a team perspective
Docker from a team perspective
 
AllTheTalks 2020: Buildpacks - container for everyone!
AllTheTalks 2020: Buildpacks - container for everyone!AllTheTalks 2020: Buildpacks - container for everyone!
AllTheTalks 2020: Buildpacks - container for everyone!
 
docker compose
docker composedocker compose
docker compose
 
Dockerfiles & Best Practices
Dockerfiles & Best PracticesDockerfiles & Best Practices
Dockerfiles & Best Practices
 
Docker at MoneyBird
Docker at MoneyBirdDocker at MoneyBird
Docker at MoneyBird
 
from docker run to docker compose (Webelement #36)
from docker run to docker compose (Webelement #36)from docker run to docker compose (Webelement #36)
from docker run to docker compose (Webelement #36)
 
Boston Code Dojo - Docker meetup slides
Boston Code Dojo - Docker meetup slidesBoston Code Dojo - Docker meetup slides
Boston Code Dojo - Docker meetup slides
 
JOSA TechTalks - Docker in Production
JOSA TechTalks - Docker in ProductionJOSA TechTalks - Docker in Production
JOSA TechTalks - Docker in Production
 
Introduction to Docker for NodeJs developers at Node DC 2/26/2014
Introduction to Docker for NodeJs developers at Node DC 2/26/2014Introduction to Docker for NodeJs developers at Node DC 2/26/2014
Introduction to Docker for NodeJs developers at Node DC 2/26/2014
 
Docker off the grid
Docker off the gridDocker off the grid
Docker off the grid
 
Docker quick start
Docker quick startDocker quick start
Docker quick start
 
Docker + Tenserflow + GOlang - Golang singapore Meetup
Docker + Tenserflow + GOlang - Golang singapore MeetupDocker + Tenserflow + GOlang - Golang singapore Meetup
Docker + Tenserflow + GOlang - Golang singapore Meetup
 
Developer workflow with docker
Developer workflow with dockerDeveloper workflow with docker
Developer workflow with docker
 
Introducing docker
Introducing dockerIntroducing docker
Introducing docker
 
Docker session I: Continuous integration, delivery and deployment
Docker session I: Continuous integration, delivery and deploymentDocker session I: Continuous integration, delivery and deployment
Docker session I: Continuous integration, delivery and deployment
 
Run automated tests in Docker
Run automated tests in DockerRun automated tests in Docker
Run automated tests in Docker
 
Building CLI Applications with Golang
Building CLI Applications with GolangBuilding CLI Applications with Golang
Building CLI Applications with Golang
 

Similar to Docker 101

Docker primer and tips
Docker primer and tipsDocker primer and tips
Docker primer and tipsSamuel Chow
 
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
 
DevAssistant, Docker and You
DevAssistant, Docker and YouDevAssistant, Docker and You
DevAssistant, Docker and YouBalaBit
 
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
 
[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101Naukri.com
 
Magento Docker Setup.pdf
Magento Docker Setup.pdfMagento Docker Setup.pdf
Magento Docker Setup.pdfAbid Malik
 
Future of Cloud Computing with Containers
Future of Cloud Computing with ContainersFuture of Cloud Computing with Containers
Future of Cloud Computing with ContainersLakmal Warusawithana
 
Getting started with docker (2017)
Getting started with docker (2017)Getting started with docker (2017)
Getting started with docker (2017)JEMLI Fathi
 
Week 8 lecture material
Week 8 lecture materialWeek 8 lecture material
Week 8 lecture materialAnkit Gupta
 
Docker for developers
Docker for developersDocker for developers
Docker for developersDrupalDay
 
Docker dev ops for cd meetup 12-14
Docker dev ops for cd meetup 12-14Docker dev ops for cd meetup 12-14
Docker dev ops for cd meetup 12-14Simon Storm
 
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
 
Cloud Run and Containers
Cloud Run and ContainersCloud Run and Containers
Cloud Run and ContainersOmar Fathy
 
Using Docker to boost your development experience with Drupal
Using Docker to boost your development experience with DrupalUsing Docker to boost your development experience with Drupal
Using Docker to boost your development experience with Drupaldockerizedrupal
 
Docker - What it is and how to get started?
Docker - What it is and how to get started?Docker - What it is and how to get started?
Docker - What it is and how to get started?Niko Virtala
 
Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned  Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned RightScale
 

Similar to Docker 101 (20)

Docker primer and tips
Docker primer and tipsDocker primer and tips
Docker primer and tips
 
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
 
DevAssistant, Docker and You
DevAssistant, Docker and YouDevAssistant, Docker and You
DevAssistant, Docker and You
 
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
 
[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101
 
Magento Docker Setup.pdf
Magento Docker Setup.pdfMagento Docker Setup.pdf
Magento Docker Setup.pdf
 
Future of Cloud Computing with Containers
Future of Cloud Computing with ContainersFuture of Cloud Computing with Containers
Future of Cloud Computing with Containers
 
Getting started with docker (2017)
Getting started with docker (2017)Getting started with docker (2017)
Getting started with docker (2017)
 
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
 
Week 8 lecture material
Week 8 lecture materialWeek 8 lecture material
Week 8 lecture material
 
Docker for developers
Docker for developersDocker for developers
Docker for developers
 
Docker dev ops for cd meetup 12-14
Docker dev ops for cd meetup 12-14Docker dev ops for cd meetup 12-14
Docker dev ops for cd meetup 12-14
 
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
 
Cloud Run and Containers
Cloud Run and ContainersCloud Run and Containers
Cloud Run and Containers
 
Docker handons-workshop-for-charity
Docker handons-workshop-for-charityDocker handons-workshop-for-charity
Docker handons-workshop-for-charity
 
Using Docker to boost your development experience with Drupal
Using Docker to boost your development experience with DrupalUsing Docker to boost your development experience with Drupal
Using Docker to boost your development experience with Drupal
 
Docker - What it is and how to get started?
Docker - What it is and how to get started?Docker - What it is and how to get started?
Docker - What it is and how to get started?
 
Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned  Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned
 

Recently uploaded

Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfLivetecs LLC
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noidabntitsolutionsrishis
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 

Recently uploaded (20)

Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdf
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 

Docker 101

  • 1. Docker 101 What's Docker and How to use? version: 2
  • 2. Agenda ● What is Docker? ● What is the difference from virtualization? ● Why do we need Docker? ● Container, Image and Layer ● Examples ● Best My Practices ● Discussion
  • 4. Docker is a container management service When you develop an application, you need to provide your code alongside with all possible dependencies like libraries, web server, databases, etc. You may end up in a situation when the application is working on your computer but won’t even start on stage env., dev env. or a QA’s machine. This challenge can be addressed by isolating the app to make it independent of the system.
  • 5. Package software into standardized units for development, shipment and deployment Containers isolate software from its surroundings, for example differences between development and staging environments and help reduce conflicts between teams running different software on the same infrastructure.
  • 6. What is the difference from virtualization?
  • 7. Comparing Containers and Virtual Machines
  • 8. Containers and Virtual Machines Together
  • 9. Why do we need Docker?
  • 10. The list of benefits is the following ● Faster development process. There is no need to install 3rd parties like PostgreSQL, Redis, Elasticsearch. Those can be run in containers. ● Handy application encapsulation (you can deliver your application in one piece). ● Same behaviour on local machine / dev / stage / production servers. ● Easy and clear monitoring. ● Easy to scale (if you’ve done your application right it will be ready to scaling not only in Docker).
  • 12. Live Demo 1. Hello world 2. Nginx 3. Writing Dockerfile 4. *Docker Compose a. Python + Redis b. Wordpress
  • 14. Dockerfile Mapping FROM ubuntu:15.04 COPY . /app RUN make /app CMD python /app/app.py
  • 15. Container, Image and Layer FROM ubuntu:15.04 COPY . /app RUN make /app CMD python /app/app.py
  • 17. Create Images ● Include only necessary context — use a .dockerignore file (like .gitignore in git) ● Avoid installing unnecessary packages — it will consume extra disk space ● Use cache. Add context which changes a lot (for example source code of your project) at the end of Dockerfile — it will utilize Docker cache effectively. ● Be careful with volumes. You should remember what data is in volumes. Because volumes are persistent and don’t die with the containers - next container will use data from volume which was created by previous container. ● Use environment variables (in RUN, EXPOSE, VOLUME). It will make your Dockerfile more flexible. ● Use multi-stage builds to reduce image size(Docker 17.05 above)
  • 18. Container Tips ● 1 application = 1 container ● Run process in foreground (don't use systemd, upstart or any other similar tools) ● Keep data out of container — use volumes ● Do not use SSH (if you need to step into container you can use docker execcommand) ● Avoid manual configurations (or actions) inside container
  • 21. Why do you need Docker?
  • 22. How will you use Docker?
  • 25. ● What is Docker and How to Use it With Python (Tutorial) ● Docker Documentation ● Docker 入門與實戰 ● Docker 容器與容器雲 ● Examples