SlideShare a Scribd company logo
1 of 65
Download to read offline
ANIL DOLLOR,
Sr. Software Engineer,
DOLLORINFOTECH, INDIA
+91-7999452711(WhatsApp)
About Me
● Sr. Software Engineer - DOLLOR INFOTECH
● YouTuber - OKLABS Channel
● Professor - Gyanodaya College, Neemuch,MP, INDIA
● dollorinfotech@gmail.com
● https://www.linkedin.com/in/anildalar
● https://github.com/anildalar
Join my Youtube Channel
https://youtube.com/oklabsguru
Why we are learning Docker ?
1. Docker gives you virtual OS Environment.
2. MicroService App runs on Isolated Environment
3. Deliver the application faster.
No need worry about "Production/Test release failures"
Now you can't say
"Hey its working on my Local but not sure why its not working on production/test server :)".
4. Docker gives you a guaranteed same development environment on all 3 phase
1. Development
2. Testing
3. Production
Who should learn Docker
● Developers
● DevOps Engineer
● Linux System Administrators
● Data Scientist
https://www.docker.com/
https://hub.docker.com/
Pre-requisites
Linux basics commands
Docker Architecture
Docker Architecture Consist of 3 Components
1. Docker Client ( Tool/Software that you install on your machine)
2. Docker Daemon ( Service that run inside your machine as background service)
3. Docker Registry (Website/Cloud App)
Docker Engine Architecture
Practical Lab Assignment
1. We will Create a Docker Hub Account
2. Download the image
3. Build Container from image
4. Run the Container
6. Go inside the container
7. Exit from container
8. Stop the Container/ Re Run it
9. Upload the image to docker hub.
9.1 Public Mode
9.2 Private Mode
10. Student will download my Docker Hub image onto their machine
DOCKER COMMANDS
Download the image
Syntax
docker pull <imagename>:<tagname>
Example
docker pull node:latest
DOCKER COMMANDS
Display the downloaded images
Example
docker images
or
docker image ls
DOCKER COMMANDS
Display the details of image
Syntax
docker inspect <imagename>
Example
docker image python
DOCKER COMMANDS
Remove docker image
Example
docker rmi <ImageId>
rmi = Remove Image
DOCKER COMMANDS
Create Container from image
Syntax
docker container create --name <containerName> <baseimage>
or
docker create --name <containerName> <baseimage>
Syntax
docker container create --name nginx_base -p 80:80 nginx:alpine
docker create --name nginx_base -p 80:80 nginx:alpine
DOCKER COMMANDS
Run the Container
Syntax
docker run <flags> <containerName> <shell>
Example
docker run -dp 80:80 myimage
-d = -d flag to run the container in detached mode (background service)
-p = -p flag is used to open the port of application
DOCKER COMMANDS
Go inside the container
Syntax
docker exec <flag> <containerId> <shell>
Example
docker exec -it #283aas9878a /bin/bash
-i = --interactive or -i flag to indicate that the container’s STDIN should be opened.
-t = -t flag to allocate a psuedo-TTY to be able to run interactive commands
DOCKER COMMANDS
Listing All Running Containers
docker ps
DOCKER COMMANDS
Listing All Stopped or Started Containers
docker ps -a
Copy a file from the host to a container
Syntax
docker cp TARGET CONTAINER:SOURCE
Example
docker cp index.html web:/index.html
Copy a file from a container to the host
Syntax
docker cp CONTAINER:SOURCE TARGET
Example
docker cp web:/index.html index.html
It's hard to start with fresh OS images
Better to use Technology Specific Images
Suppose if you are a Node Js Developer better to start with node image instead of
using ubuntu and install node in the image.
Will be waste of our time . So we will use
docker pull node:latest
Suppose you are a Python Developer the your will use
docker pull python:latest
Ports
Ports are communication path of a
operating system
(i.e container)
PORT?
Open
Close
Understand Dockerfile
Build Your Own Image/Container
You can build your own container/image using a “Dockerfile”
Syntax
docker image build -t ImageName:TagName dir
or
docker build -t ImageName:TagName dir
Example
docker build -t myimage:1.0.0 .
Docker - File
Dockerfile Sample (NodeJS)
FROM node
WORKDIR /var/www/rtc_app
COPY . .
RUN npm install
EXPOSE 5000
CMD ["node","backend/server.js"]
Dockerfile Sample (Python)
FROM python:latest
WORKDIR /home
COPY . .
RUN python -m pip install -r requirements.txt
EXPOSE 8000
RUN django-admin startproject anil .
CMD [ "python","manage.py","runserver","0.0.0.0:8000" ]
Biggest problem for us now.
"I want to work in host OS but wanted to
see the changes in running container"
The Next Topic "Volume/Mounting" will
give this answer
Volume Mounting
Sharing FileSystem with container.
There are 2 Ways
1. Using Command line
2. Using Docker compose file
Note
You can't mount a VOLUME in a Dockerfile specifying both source (host)
and destination (container) paths.
This is because this idea does not fit the basic concept that Docker image is
portable and independent of host.
How container can talk to each other ?
Application Database
By default containers are isolated, means all
ports are closed, so container can not talk to
each other
But ….Some way by which container can talk to
each other.
There are 2 Ways
1. Expose the port of container, and allow containers to talk
to each other with host OS. ( Not Recommended )
2. Put the containers inside one network. ( Recommended )
Docker Compose
1. Docker compose is a tool which read a docker-compose.yml file.
2. Build the container according to the commands/instructions
provided in the file.
Docker compose ( Installation not required on windows)
Docker compose ( Installation is required on linux )
YAML: YAML Ain't Markup Language
Best Practice
One service per container
version: '3.9'
services:
service1:
container_name: node_cont
build: .
depends_on:
- db
ports:
- '5000:5000'
volumes:
- .:/app
- /app/node_modules
db:
image: 'postgres:latest'
container_name: db_cont
ports:
- '5432:5432'
environment:
POSTGRES_PASSWORD: 'mysecretpassword'
POSTGRES_USER: 'oklabs'
DOCKER COMMANDS
Push image to Docker Hub
docker login
docker tag firstimage YOUR_DOCKERHUB_NAME/firstimage
docker push YOUR_DOCKERHUB_NAME/firstimage
Note:-
docker image build read and build the "Dockerfile" file
docker-compose read and build the "docker-compose.yml" file
docker build Dockerfile
docker-compose docker-compose.yml
Build
Look
Build
Look
Container
Docker Terminology
Docker Image
Docker Container
Docker Daemon
Docker Registry
Docker Client
Dockerfile
Database
# DB Name DB Type DB GUI PORT
Links
1 MongoDB NoSQL
MongoDB
Compass
27017
https://www.mongodb.com/try/
download/compass
2 Redis DB NoSQL Redis Insight 6379
https://redis.com/redis-enterpri
se/redis-insight/
3 MySQL SQL Workbench 3306
https://dev.mysql.com/downlo
ads/workbench/
4 PostGres SQL PgAdmin 5432
https://www.pgadmin.org/dow
nload/
Docker Assignment
NoSQL DBs
Download mongo image and implement the nodejs / python code.
Download redis image and implement the nodejs/python code.
SQL DBs
Download mysql image and implement the nodejs / python code.
Download postgres image and implement the nodejs / python code.
Imp Commands
docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -p 3306:3306 -d mysql:tag
docker run --name postgres-db -e POSTGRES_PASSWORD=mysecretpassword -p 5432:5432 -d postgres
Remember
Stop the database services in Host Machine
Solution for windows :
1. Stop docker container
2. win + r and type services.msc
3. Find postgres/mongo services and stop
4. Start your container again
Notes
By default containers are isolated, means all ports are closed.
We can open the port in 3 Ways
1. using EXPOSE command in Dockerfile.
2. Using --expose flag in docker run command.
3. Using docker-compose
So external service can talk to container and vice versa.
docker run = docker pull + docker create + docker start
nodemon -L <script_file>
docker logs -f <container_name>
Q & A
How to check which containers are running ? docker ps
Write down any 5 Dockerfile commands?
Which is the first Dockerfile command ? FROM
What is the command to stop all running container ? docker stop $(docker ps -q)
What is the command to stop all container ? docker stop $(docker ps -a -q)
What is the command to remove all containers ? docker rm $(docker ps -a -q)
What is the command to remove the image? docker rmi imagename/imageId
Useful docker commands
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
docker-compose up --build -d
Do you what to learn Software Development ?
I have 10 Yrs of Teaching and Software industry Experience.
Your can contact me on whatsApp +91-7999452711 or anildalar8888@gmail.com.
I teach my students across the globe.
Classes are daily basis Monday to Saturday 2 Hr Daily,
Daily Assignment, Daily Quiz, Daily Practice .
After the Training you will get Training and Experience Certifications form OKLABS
and DOLLORINFOTECH respectively .
100% placement after the training..
Course Details
GIT, HTML5,CSS3,BootStrap,JS,JQuery, ReactJS ,NodeJS,ExpressJS,
MongoDB,MySQL,Redis,PostGres (All Dbs SQL n NoSQL), Docker,NgRok
Live Project Deployment
Placement IN MNC
Certificates
1. OKLABS Training Certificate (1 Year)
1. DOLLOR INFOTECH Experience Certificate (1 Year)
FullStack 1K USD
Student Can Pay in 3 EMI
333USD x 3
In order to enroll You Must pay 1 EMI
All Videos will be Private VIdeos.
1. Daily Class (Monday to Saturday 8:30 AM IST - 9:30 AM IST)
2. Daily Assignment
3. Daily Quiz
4. You will be added into the WhatSAPP Group for Discussion
5. You can Call for Doubts and have anydesk session for discussion
Docker Introduction.pdf

More Related Content

What's hot

Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to dockerJohn Willis
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to dockerInstruqt
 
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...Edureka!
 
Docker 101: An Introduction
Docker 101: An IntroductionDocker 101: An Introduction
Docker 101: An IntroductionPOSSCON
 
Web Services
Web ServicesWeb Services
Web Serviceschidi
 
Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...
Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...
Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...Edureka!
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to DockerAditya Konarde
 
Software Containerization
Software ContainerizationSoftware Containerization
Software ContainerizationRoshan Deniyage
 
Dockers and containers basics
Dockers and containers basicsDockers and containers basics
Dockers and containers basicsSourabh Saxena
 
Introduction to API
Introduction to APIIntroduction to API
Introduction to APIrajnishjha29
 
Getting started with Docker
Getting started with DockerGetting started with Docker
Getting started with DockerRavindu Fernando
 
Docker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and ContainersDocker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and ContainersYajushi Srivastava
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker IntroductionRobert Reiz
 
Enterprise java unit-1_chapter-3
Enterprise java unit-1_chapter-3Enterprise java unit-1_chapter-3
Enterprise java unit-1_chapter-3sandeep54552
 
Docker introduction
Docker introductionDocker introduction
Docker introductionPhuc Nguyen
 

What's hot (20)

Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
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
DockerDocker
Docker
 
Docker & kubernetes
Docker & kubernetesDocker & kubernetes
Docker & kubernetes
 
Docker 101: An Introduction
Docker 101: An IntroductionDocker 101: An Introduction
Docker 101: An Introduction
 
Web Services
Web ServicesWeb Services
Web Services
 
Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...
Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...
Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Software Containerization
Software ContainerizationSoftware Containerization
Software Containerization
 
What is Docker
What is DockerWhat is Docker
What is Docker
 
Dockers and containers basics
Dockers and containers basicsDockers and containers basics
Dockers and containers basics
 
Maven ppt
Maven pptMaven ppt
Maven ppt
 
Introduction to API
Introduction to APIIntroduction to API
Introduction to API
 
Getting started with Docker
Getting started with DockerGetting started with Docker
Getting started with Docker
 
Docker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and ContainersDocker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and Containers
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Enterprise java unit-1_chapter-3
Enterprise java unit-1_chapter-3Enterprise java unit-1_chapter-3
Enterprise java unit-1_chapter-3
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 

Similar to Docker Introduction.pdf

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
 
[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안양재동 코드랩
 
Docker in everyday development
Docker in everyday developmentDocker in everyday development
Docker in everyday developmentJustyna Ilczuk
 
Docker Security workshop slides
Docker Security workshop slidesDocker Security workshop slides
Docker Security workshop slidesDocker, Inc.
 
DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline  DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline Docker, Inc.
 
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
 
Primi passi con Docker - ItalianCoders - 12-01-2021
Primi passi con Docker - ItalianCoders - 12-01-2021Primi passi con Docker - ItalianCoders - 12-01-2021
Primi passi con Docker - ItalianCoders - 12-01-2021Alessandro Mignogna
 
Getting started docker notes
Getting started docker notesGetting started docker notes
Getting started docker notesAJAY NAYAK
 
Tips pour sécuriser ses conteneurs docker/podman
Tips pour sécuriser ses conteneurs docker/podmanTips pour sécuriser ses conteneurs docker/podman
Tips pour sécuriser ses conteneurs docker/podmanThierry Gayet
 
Docker: A New Way to Turbocharging Your Apps Development
Docker: A New Way to Turbocharging Your Apps DevelopmentDocker: A New Way to Turbocharging Your Apps Development
Docker: A New Way to Turbocharging Your Apps Developmentmsyukor
 
時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇Philip Zheng
 
Docker Introductory workshop
Docker Introductory workshopDocker Introductory workshop
Docker Introductory workshopRuncy Oommen
 
Develop with docker 2014 aug
Develop with docker 2014 augDevelop with docker 2014 aug
Develop with docker 2014 augVincent De Smet
 
The Dockerfile Explosion and the Need for Higher Level Tools by Gareth Rushgrove
The Dockerfile Explosion and the Need for Higher Level Tools by Gareth RushgroveThe Dockerfile Explosion and the Need for Higher Level Tools by Gareth Rushgrove
The Dockerfile Explosion and the Need for Higher Level Tools by Gareth RushgroveDocker, Inc.
 
Learn enough Docker to be dangerous
Learn enough Docker to be dangerousLearn enough Docker to be dangerous
Learn enough Docker to be dangerousDavid Tan
 

Similar to Docker Introduction.pdf (20)

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
 
Learning Docker with Thomas
Learning Docker with ThomasLearning Docker with Thomas
Learning Docker with Thomas
 
[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안
 
Docking with Docker
Docking with DockerDocking with Docker
Docking with Docker
 
How to _docker
How to _dockerHow to _docker
How to _docker
 
Docker in everyday development
Docker in everyday developmentDocker in everyday development
Docker in everyday development
 
Docker Security workshop slides
Docker Security workshop slidesDocker Security workshop slides
Docker Security workshop slides
 
DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline  DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline
 
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
DockerDocker
Docker
 
Primi passi con Docker - ItalianCoders - 12-01-2021
Primi passi con Docker - ItalianCoders - 12-01-2021Primi passi con Docker - ItalianCoders - 12-01-2021
Primi passi con Docker - ItalianCoders - 12-01-2021
 
Docker, c'est bonheur !
Docker, c'est bonheur !Docker, c'est bonheur !
Docker, c'est bonheur !
 
Getting started docker notes
Getting started docker notesGetting started docker notes
Getting started docker notes
 
Tips pour sécuriser ses conteneurs docker/podman
Tips pour sécuriser ses conteneurs docker/podmanTips pour sécuriser ses conteneurs docker/podman
Tips pour sécuriser ses conteneurs docker/podman
 
Docker: A New Way to Turbocharging Your Apps Development
Docker: A New Way to Turbocharging Your Apps DevelopmentDocker: A New Way to Turbocharging Your Apps Development
Docker: A New Way to Turbocharging Your Apps Development
 
時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇
 
Docker Introductory workshop
Docker Introductory workshopDocker Introductory workshop
Docker Introductory workshop
 
Develop with docker 2014 aug
Develop with docker 2014 augDevelop with docker 2014 aug
Develop with docker 2014 aug
 
The Dockerfile Explosion and the Need for Higher Level Tools by Gareth Rushgrove
The Dockerfile Explosion and the Need for Higher Level Tools by Gareth RushgroveThe Dockerfile Explosion and the Need for Higher Level Tools by Gareth Rushgrove
The Dockerfile Explosion and the Need for Higher Level Tools by Gareth Rushgrove
 
Learn enough Docker to be dangerous
Learn enough Docker to be dangerousLearn enough Docker to be dangerous
Learn enough Docker to be dangerous
 

Recently uploaded

Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 

Recently uploaded (20)

Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 

Docker Introduction.pdf

  • 1. ANIL DOLLOR, Sr. Software Engineer, DOLLORINFOTECH, INDIA +91-7999452711(WhatsApp)
  • 2. About Me ● Sr. Software Engineer - DOLLOR INFOTECH ● YouTuber - OKLABS Channel ● Professor - Gyanodaya College, Neemuch,MP, INDIA ● dollorinfotech@gmail.com ● https://www.linkedin.com/in/anildalar ● https://github.com/anildalar
  • 3. Join my Youtube Channel https://youtube.com/oklabsguru
  • 4. Why we are learning Docker ? 1. Docker gives you virtual OS Environment. 2. MicroService App runs on Isolated Environment 3. Deliver the application faster. No need worry about "Production/Test release failures" Now you can't say "Hey its working on my Local but not sure why its not working on production/test server :)". 4. Docker gives you a guaranteed same development environment on all 3 phase 1. Development 2. Testing 3. Production
  • 5. Who should learn Docker ● Developers ● DevOps Engineer ● Linux System Administrators ● Data Scientist
  • 6.
  • 9.
  • 10. Docker Architecture Docker Architecture Consist of 3 Components 1. Docker Client ( Tool/Software that you install on your machine) 2. Docker Daemon ( Service that run inside your machine as background service) 3. Docker Registry (Website/Cloud App)
  • 11.
  • 13.
  • 14.
  • 15. Practical Lab Assignment 1. We will Create a Docker Hub Account 2. Download the image 3. Build Container from image 4. Run the Container 6. Go inside the container 7. Exit from container 8. Stop the Container/ Re Run it 9. Upload the image to docker hub. 9.1 Public Mode 9.2 Private Mode 10. Student will download my Docker Hub image onto their machine
  • 16. DOCKER COMMANDS Download the image Syntax docker pull <imagename>:<tagname> Example docker pull node:latest
  • 17. DOCKER COMMANDS Display the downloaded images Example docker images or docker image ls
  • 18. DOCKER COMMANDS Display the details of image Syntax docker inspect <imagename> Example docker image python
  • 19. DOCKER COMMANDS Remove docker image Example docker rmi <ImageId> rmi = Remove Image
  • 20. DOCKER COMMANDS Create Container from image Syntax docker container create --name <containerName> <baseimage> or docker create --name <containerName> <baseimage> Syntax docker container create --name nginx_base -p 80:80 nginx:alpine docker create --name nginx_base -p 80:80 nginx:alpine
  • 21. DOCKER COMMANDS Run the Container Syntax docker run <flags> <containerName> <shell> Example docker run -dp 80:80 myimage -d = -d flag to run the container in detached mode (background service) -p = -p flag is used to open the port of application
  • 22. DOCKER COMMANDS Go inside the container Syntax docker exec <flag> <containerId> <shell> Example docker exec -it #283aas9878a /bin/bash -i = --interactive or -i flag to indicate that the container’s STDIN should be opened. -t = -t flag to allocate a psuedo-TTY to be able to run interactive commands
  • 23. DOCKER COMMANDS Listing All Running Containers docker ps
  • 24. DOCKER COMMANDS Listing All Stopped or Started Containers docker ps -a
  • 25. Copy a file from the host to a container Syntax docker cp TARGET CONTAINER:SOURCE Example docker cp index.html web:/index.html
  • 26. Copy a file from a container to the host Syntax docker cp CONTAINER:SOURCE TARGET Example docker cp web:/index.html index.html
  • 27. It's hard to start with fresh OS images Better to use Technology Specific Images Suppose if you are a Node Js Developer better to start with node image instead of using ubuntu and install node in the image. Will be waste of our time . So we will use docker pull node:latest Suppose you are a Python Developer the your will use docker pull python:latest
  • 28. Ports Ports are communication path of a operating system (i.e container)
  • 31. Build Your Own Image/Container You can build your own container/image using a “Dockerfile” Syntax docker image build -t ImageName:TagName dir or docker build -t ImageName:TagName dir Example docker build -t myimage:1.0.0 . Docker - File
  • 32.
  • 33. Dockerfile Sample (NodeJS) FROM node WORKDIR /var/www/rtc_app COPY . . RUN npm install EXPOSE 5000 CMD ["node","backend/server.js"]
  • 34. Dockerfile Sample (Python) FROM python:latest WORKDIR /home COPY . . RUN python -m pip install -r requirements.txt EXPOSE 8000 RUN django-admin startproject anil . CMD [ "python","manage.py","runserver","0.0.0.0:8000" ]
  • 35. Biggest problem for us now. "I want to work in host OS but wanted to see the changes in running container" The Next Topic "Volume/Mounting" will give this answer
  • 37. There are 2 Ways 1. Using Command line 2. Using Docker compose file
  • 38. Note You can't mount a VOLUME in a Dockerfile specifying both source (host) and destination (container) paths. This is because this idea does not fit the basic concept that Docker image is portable and independent of host.
  • 39.
  • 40. How container can talk to each other ? Application Database
  • 41.
  • 42. By default containers are isolated, means all ports are closed, so container can not talk to each other But ….Some way by which container can talk to each other.
  • 43. There are 2 Ways 1. Expose the port of container, and allow containers to talk to each other with host OS. ( Not Recommended ) 2. Put the containers inside one network. ( Recommended )
  • 45. 1. Docker compose is a tool which read a docker-compose.yml file. 2. Build the container according to the commands/instructions provided in the file. Docker compose ( Installation not required on windows) Docker compose ( Installation is required on linux )
  • 46. YAML: YAML Ain't Markup Language
  • 47. Best Practice One service per container
  • 48.
  • 49. version: '3.9' services: service1: container_name: node_cont build: . depends_on: - db ports: - '5000:5000' volumes: - .:/app - /app/node_modules db: image: 'postgres:latest' container_name: db_cont ports: - '5432:5432' environment: POSTGRES_PASSWORD: 'mysecretpassword' POSTGRES_USER: 'oklabs'
  • 50. DOCKER COMMANDS Push image to Docker Hub docker login docker tag firstimage YOUR_DOCKERHUB_NAME/firstimage docker push YOUR_DOCKERHUB_NAME/firstimage
  • 51. Note:- docker image build read and build the "Dockerfile" file docker-compose read and build the "docker-compose.yml" file
  • 52. docker build Dockerfile docker-compose docker-compose.yml Build Look Build Look Container
  • 53. Docker Terminology Docker Image Docker Container Docker Daemon Docker Registry Docker Client Dockerfile
  • 54. Database # DB Name DB Type DB GUI PORT Links 1 MongoDB NoSQL MongoDB Compass 27017 https://www.mongodb.com/try/ download/compass 2 Redis DB NoSQL Redis Insight 6379 https://redis.com/redis-enterpri se/redis-insight/ 3 MySQL SQL Workbench 3306 https://dev.mysql.com/downlo ads/workbench/ 4 PostGres SQL PgAdmin 5432 https://www.pgadmin.org/dow nload/
  • 55. Docker Assignment NoSQL DBs Download mongo image and implement the nodejs / python code. Download redis image and implement the nodejs/python code. SQL DBs Download mysql image and implement the nodejs / python code. Download postgres image and implement the nodejs / python code.
  • 56. Imp Commands docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -p 3306:3306 -d mysql:tag docker run --name postgres-db -e POSTGRES_PASSWORD=mysecretpassword -p 5432:5432 -d postgres
  • 57. Remember Stop the database services in Host Machine Solution for windows : 1. Stop docker container 2. win + r and type services.msc 3. Find postgres/mongo services and stop 4. Start your container again
  • 58. Notes By default containers are isolated, means all ports are closed. We can open the port in 3 Ways 1. using EXPOSE command in Dockerfile. 2. Using --expose flag in docker run command. 3. Using docker-compose So external service can talk to container and vice versa. docker run = docker pull + docker create + docker start nodemon -L <script_file> docker logs -f <container_name>
  • 59. Q & A How to check which containers are running ? docker ps Write down any 5 Dockerfile commands? Which is the first Dockerfile command ? FROM What is the command to stop all running container ? docker stop $(docker ps -q) What is the command to stop all container ? docker stop $(docker ps -a -q) What is the command to remove all containers ? docker rm $(docker ps -a -q) What is the command to remove the image? docker rmi imagename/imageId
  • 60. Useful docker commands docker stop $(docker ps -a -q) docker rm $(docker ps -a -q) docker-compose up --build -d
  • 61. Do you what to learn Software Development ? I have 10 Yrs of Teaching and Software industry Experience. Your can contact me on whatsApp +91-7999452711 or anildalar8888@gmail.com. I teach my students across the globe. Classes are daily basis Monday to Saturday 2 Hr Daily, Daily Assignment, Daily Quiz, Daily Practice . After the Training you will get Training and Experience Certifications form OKLABS and DOLLORINFOTECH respectively . 100% placement after the training..
  • 63. GIT, HTML5,CSS3,BootStrap,JS,JQuery, ReactJS ,NodeJS,ExpressJS, MongoDB,MySQL,Redis,PostGres (All Dbs SQL n NoSQL), Docker,NgRok Live Project Deployment Placement IN MNC Certificates 1. OKLABS Training Certificate (1 Year) 1. DOLLOR INFOTECH Experience Certificate (1 Year)
  • 64. FullStack 1K USD Student Can Pay in 3 EMI 333USD x 3 In order to enroll You Must pay 1 EMI All Videos will be Private VIdeos. 1. Daily Class (Monday to Saturday 8:30 AM IST - 9:30 AM IST) 2. Daily Assignment 3. Daily Quiz 4. You will be added into the WhatSAPP Group for Discussion 5. You can Call for Doubts and have anydesk session for discussion