SlideShare a Scribd company logo
Docker: Introduction and its
Usage in Machine Learning
By: Yogendra Singh
IIT Indore
What is Docker?
• Lightweight, open, secure platform
• Simplify building, shipping, running apps
• Runs natively on Linux or Windows
Server
• Runs on Windows or Mac
Development machines (with a
virtual machine)
• Relies on "images" and "containers"
Docker is a software platform that allows you to build, test, and
deploy applications quickly, packaging software into
standardized units called containers.
Get Docker
• Installation instructions available in https://docs.docker.com/get-docker/
• For Linux, Windows and Mac OS
Session Lab Details
• Host: atal.iiti.ac.in
• Username: atuser1, atuser2, atuser3……atuser10
• Password: atal@1234
What can I do…..“Its running on my PC”!!!!
What are containers?
Source: docs.docker.com
• Container ≠ VM
• Isolated
• Share OS
• and sometimes bins/libs
• Standardized packaging for
software and dependencies
• Isolate apps from each other
• Share the same OS kernel
• Works for all major Linux
distributions
• Containers native to Windows
Server 2016
…..What is a container?
Docker Image
Example: Ubuntu with Node.js and
Application Code
Docker Container
Created by using an image. Runs
your application.
The Role of Images and Containers
Some Docker vocabulary
Docker Image
The basis of a Docker container. Represents a full application
Docker Container
The standard unit in which the application service resides and executes
Docker Engine
Creates, ships and runs Docker containers deployable on a physical or virtual, host
locally, in a datacenter or cloud service provider
Registry Service (Docker Hub (Public) or Docker Trusted Registry (Private)
Cloud or server based storage and distribution service for your images
Docker Commands
Basic Docker Commands
$ docker pull node:latest
$ docker ps
$ docker container run –d –p 5000:5000 –-name node node:latest
$ docker ps
$ docker stop node(or <container id>)
$ docker rm node (or <container id>)
$ docker rmi (or <image id>)
$ docker --help
Basic Docker Commands
$ docker logs <cid>
$ docker run -it -p 8888:8888 -v /home/atal/www/:/home/jovyan/ jupyter/tensorflow-
notebook:latest
$ docker inspect
$ docker ps
$ docker stop node(or <container id>)
$ docker rm node (or <container id>)
$ docker rmi (or <image id>)
$ docker --help
Basic Docker Commands
14
Dockerfile – Linux Example
• Instructions on
how to build a
Docker image
• Looks very similar
to “native”
commands
• Important to
optimize your
Dockerfile
Section 2:
Anatomy of a Docker Container
Docker Volumes
Volume Use Cases
Let’s Go Back to Our Dockerfile
17
Each Dockerfile Command Creates a Layer
Kernel
FROM
18
RUN
WORKDIR
COPY
EXPOSE
…
Docker Image Pull: Pulls Layers
19
Docker Volumes
20
• Volumes mount a directory on the host into the container at a specific location
• Can be used to share (and persist) data between containers
• Directory persists after the container is deleted
• Unless you explicitly delete it
• Can be created in a Dockerfile or via CLI
Why Use Volumes
21
• Mount local source code into a running container
docker container run -v $(pwd):/usr/src/app/
myapp
• Improve performance
− As directory structures get complicated traversing the tree can slow system
performance
• Data persistence
Section 3:
Networking
What is Docker Bridge Networking
Docker host
bridgenet1
Cntnr 1 Cntnr 2 Cntnr 3
Docker host
bridgenet2
Cntnr 4 Cntnr 5 Cntnr 6
bridgenet3
Cntnr 7
docker network create -d bridge --name bridgenet1
23
Docker Bridge Networking and Port Mapping
Docker host 1
Bridge
Cntnr1
10.0.0.8
L2/L3 physical network
:80
:8080
172.14.3.55
$ docker container run -p 8080:80 ...
Host port
24
Container port
Section 4:
Docker Compose
Docker Compose: Multi Container Applications
49
• Build and run one container at a time
• Manually connect containers together
• Must be careful with dependencies and start
up order
• Define multi container app in compose.yml file
• Single command to deploy entire app
• Handles container dependencies
• Works with Docker Swarm, Networking,
Volumes, Universal Control Plane
version: '2' # specify docker-compose version
# Define the services/containers to be run
services:
angular: # name of the first service
build: client # specify the directory of the Dockerfile
ports:
- "4200:4200" # specify port forewarding
express: #name of the second service
build: api # specify the directory of the Dockerfile
ports:
- "3977:3977" #specify ports forewarding
database: # name of the third service
image: mongo # specify image to build container from
ports:
- "27017:27017" # specify port forewarding
Docker Compose: Multi Container Applications
Docker images
• Docker Hub
• Dockerfile
Docker Hub
Dockerfile
• It is possible to build your own images reading instructions
from a Dockerfile
FROM centos:7
RUN yum install -y python-devel python-virtualenv
RUN virtualenv /opt/indico/venv
RUN pip install indico
COPY entrypoint.sh /opt/indico/entrypoint.sh
EXPOSE 8000
ENTRYPOINT /opt/indico/entrypoint.sh
docker-compose
• Allows to run multi-container Docker applications reading
instructions from a docker-compose.yml file
version: "2"
services:
my-application:
build: ./
ports:
- "8000:8000"
environment:
- CONFIG_FILE
db:
image: postgres
redis:
image: redis
command: redis-server --save "" --appendonly no
ports:
- "6379"
Ad

Recommended

14309525_docker_docker_docker_docker_introduction.ppt
14309525_docker_docker_docker_docker_introduction.ppt
aravym456
 
Up and running with docker
Up and running with docker
Michelle Liu
 
Docker Kubernetes Istio
Docker Kubernetes Istio
Araf Karsh Hamid
 
Docker Started
Docker Started
Victor S. Recio
 
Docker and containers - Presentation Slides by Priyadarshini Anand
Docker and containers - Presentation Slides by Priyadarshini Anand
PRIYADARSHINI ANAND
 
Deploying .net core apps to Docker - dotnetConf Local Bengaluru
Deploying .net core apps to Docker - dotnetConf Local Bengaluru
Swaminathan Vetri
 
手把手帶你學 Docker 入門篇
手把手帶你學 Docker 入門篇
Philip Zheng
 
Docker workshop 0507 Taichung
Docker workshop 0507 Taichung
Paul Chao
 
時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇
Philip Zheng
 
Powercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptx
IgnacioTamayo2
 
Docker Basics
Docker Basics
DuckDuckGo
 
Docker Ecosystem on Azure
Docker Ecosystem on Azure
Patrick Chanezon
 
Docker fundamentals
Docker fundamentals
Alper Unal
 
Docker, LinuX Container
Docker, LinuX Container
Araf Karsh Hamid
 
Docker
Docker
Narato
 
Running the Oracle SOA Suite Environment in a Docker Container
Running the Oracle SOA Suite Environment in a Docker Container
Guido Schmutz
 
Docker, but what it is?
Docker, but what it is?
Julien Maitrehenry
 
手把手帶你學Docker 03042017
手把手帶你學Docker 03042017
Paul Chao
 
Docker: A New Way to Turbocharging Your Apps Development
Docker: A New Way to Turbocharging Your Apps Development
msyukor
 
Docker From Scratch
Docker From Scratch
Giacomo Vacca
 
Docker toolbox
Docker toolbox
Yonghwee Kim
 
indico-workshop-container-deployment.pdf
indico-workshop-container-deployment.pdf
ssuser8d64ca
 
indico-workshop-container-deployment.pptx
indico-workshop-container-deployment.pptx
ssuser0c1819
 
Orchestrating Docker with OpenStack
Orchestrating Docker with OpenStack
Erica Windisch
 
Cohesion Techsessie Docker - Daniel Palstra
Cohesion Techsessie Docker - Daniel Palstra
Daniel Palstra
 
How to _docker
How to _docker
Abdur Rab Marjan
 
Introduction To Docker
Introduction To Docker
Dr. Syed Hassan Amin
 
Getting Started With Docker: Simplifying DevOps
Getting Started With Docker: Simplifying DevOps
demoNguyen
 
cnc-processing-centers-centateq-p-110-en.pdf
cnc-processing-centers-centateq-p-110-en.pdf
AmirStern2
 
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 

More Related Content

Similar to Docker Introduction and its Usage in Machine Learning (20)

時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇
Philip Zheng
 
Powercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptx
IgnacioTamayo2
 
Docker Basics
Docker Basics
DuckDuckGo
 
Docker Ecosystem on Azure
Docker Ecosystem on Azure
Patrick Chanezon
 
Docker fundamentals
Docker fundamentals
Alper Unal
 
Docker, LinuX Container
Docker, LinuX Container
Araf Karsh Hamid
 
Docker
Docker
Narato
 
Running the Oracle SOA Suite Environment in a Docker Container
Running the Oracle SOA Suite Environment in a Docker Container
Guido Schmutz
 
Docker, but what it is?
Docker, but what it is?
Julien Maitrehenry
 
手把手帶你學Docker 03042017
手把手帶你學Docker 03042017
Paul Chao
 
Docker: A New Way to Turbocharging Your Apps Development
Docker: A New Way to Turbocharging Your Apps Development
msyukor
 
Docker From Scratch
Docker From Scratch
Giacomo Vacca
 
Docker toolbox
Docker toolbox
Yonghwee Kim
 
indico-workshop-container-deployment.pdf
indico-workshop-container-deployment.pdf
ssuser8d64ca
 
indico-workshop-container-deployment.pptx
indico-workshop-container-deployment.pptx
ssuser0c1819
 
Orchestrating Docker with OpenStack
Orchestrating Docker with OpenStack
Erica Windisch
 
Cohesion Techsessie Docker - Daniel Palstra
Cohesion Techsessie Docker - Daniel Palstra
Daniel Palstra
 
How to _docker
How to _docker
Abdur Rab Marjan
 
Introduction To Docker
Introduction To Docker
Dr. Syed Hassan Amin
 
Getting Started With Docker: Simplifying DevOps
Getting Started With Docker: Simplifying DevOps
demoNguyen
 
時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇
Philip Zheng
 
Powercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptx
IgnacioTamayo2
 
Docker fundamentals
Docker fundamentals
Alper Unal
 
Docker
Docker
Narato
 
Running the Oracle SOA Suite Environment in a Docker Container
Running the Oracle SOA Suite Environment in a Docker Container
Guido Schmutz
 
手把手帶你學Docker 03042017
手把手帶你學Docker 03042017
Paul Chao
 
Docker: A New Way to Turbocharging Your Apps Development
Docker: A New Way to Turbocharging Your Apps Development
msyukor
 
indico-workshop-container-deployment.pdf
indico-workshop-container-deployment.pdf
ssuser8d64ca
 
indico-workshop-container-deployment.pptx
indico-workshop-container-deployment.pptx
ssuser0c1819
 
Orchestrating Docker with OpenStack
Orchestrating Docker with OpenStack
Erica Windisch
 
Cohesion Techsessie Docker - Daniel Palstra
Cohesion Techsessie Docker - Daniel Palstra
Daniel Palstra
 
Getting Started With Docker: Simplifying DevOps
Getting Started With Docker: Simplifying DevOps
demoNguyen
 

Recently uploaded (20)

cnc-processing-centers-centateq-p-110-en.pdf
cnc-processing-centers-centateq-p-110-en.pdf
AmirStern2
 
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC
 
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Safe Software
 
10 Key Challenges for AI within the EU Data Protection Framework.pdf
10 Key Challenges for AI within the EU Data Protection Framework.pdf
Priyanka Aash
 
"Scaling in space and time with Temporal", Andriy Lupa.pdf
"Scaling in space and time with Temporal", Andriy Lupa.pdf
Fwdays
 
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Priyanka Aash
 
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
Python Conference Singapore - 19 Jun 2025
Python Conference Singapore - 19 Jun 2025
ninefyi
 
Wenn alles versagt - IBM Tape schützt, was zählt! Und besonders mit dem neust...
Wenn alles versagt - IBM Tape schützt, was zählt! Und besonders mit dem neust...
Josef Weingand
 
Mastering AI Workflows with FME by Mark Döring
Mastering AI Workflows with FME by Mark Döring
Safe Software
 
Security Tips for Enterprise Azure Solutions
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
9-1-1 Addressing: End-to-End Automation Using FME
9-1-1 Addressing: End-to-End Automation Using FME
Safe Software
 
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Priyanka Aash
 
Quantum AI: Where Impossible Becomes Probable
Quantum AI: Where Impossible Becomes Probable
Saikat Basu
 
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
Fwdays
 
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
ScyllaDB
 
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Safe Software
 
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
Edge AI and Vision Alliance
 
cnc-processing-centers-centateq-p-110-en.pdf
cnc-processing-centers-centateq-p-110-en.pdf
AmirStern2
 
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC
 
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Safe Software
 
10 Key Challenges for AI within the EU Data Protection Framework.pdf
10 Key Challenges for AI within the EU Data Protection Framework.pdf
Priyanka Aash
 
"Scaling in space and time with Temporal", Andriy Lupa.pdf
"Scaling in space and time with Temporal", Andriy Lupa.pdf
Fwdays
 
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Priyanka Aash
 
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
Python Conference Singapore - 19 Jun 2025
Python Conference Singapore - 19 Jun 2025
ninefyi
 
Wenn alles versagt - IBM Tape schützt, was zählt! Und besonders mit dem neust...
Wenn alles versagt - IBM Tape schützt, was zählt! Und besonders mit dem neust...
Josef Weingand
 
Mastering AI Workflows with FME by Mark Döring
Mastering AI Workflows with FME by Mark Döring
Safe Software
 
Security Tips for Enterprise Azure Solutions
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
9-1-1 Addressing: End-to-End Automation Using FME
9-1-1 Addressing: End-to-End Automation Using FME
Safe Software
 
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Priyanka Aash
 
Quantum AI: Where Impossible Becomes Probable
Quantum AI: Where Impossible Becomes Probable
Saikat Basu
 
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
Fwdays
 
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
ScyllaDB
 
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Safe Software
 
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
Edge AI and Vision Alliance
 
Ad

Docker Introduction and its Usage in Machine Learning

  • 1. Docker: Introduction and its Usage in Machine Learning By: Yogendra Singh IIT Indore
  • 3. • Lightweight, open, secure platform • Simplify building, shipping, running apps • Runs natively on Linux or Windows Server • Runs on Windows or Mac Development machines (with a virtual machine) • Relies on "images" and "containers" Docker is a software platform that allows you to build, test, and deploy applications quickly, packaging software into standardized units called containers.
  • 4. Get Docker • Installation instructions available in https://docs.docker.com/get-docker/ • For Linux, Windows and Mac OS
  • 5. Session Lab Details • Host: atal.iiti.ac.in • Username: atuser1, atuser2, atuser3……atuser10 • Password: atal@1234
  • 6. What can I do…..“Its running on my PC”!!!!
  • 7. What are containers? Source: docs.docker.com • Container ≠ VM • Isolated • Share OS • and sometimes bins/libs
  • 8. • Standardized packaging for software and dependencies • Isolate apps from each other • Share the same OS kernel • Works for all major Linux distributions • Containers native to Windows Server 2016 …..What is a container?
  • 9. Docker Image Example: Ubuntu with Node.js and Application Code Docker Container Created by using an image. Runs your application. The Role of Images and Containers
  • 10. Some Docker vocabulary Docker Image The basis of a Docker container. Represents a full application Docker Container The standard unit in which the application service resides and executes Docker Engine Creates, ships and runs Docker containers deployable on a physical or virtual, host locally, in a datacenter or cloud service provider Registry Service (Docker Hub (Public) or Docker Trusted Registry (Private) Cloud or server based storage and distribution service for your images
  • 12. Basic Docker Commands $ docker pull node:latest $ docker ps $ docker container run –d –p 5000:5000 –-name node node:latest $ docker ps $ docker stop node(or <container id>) $ docker rm node (or <container id>) $ docker rmi (or <image id>) $ docker --help
  • 13. Basic Docker Commands $ docker logs <cid> $ docker run -it -p 8888:8888 -v /home/atal/www/:/home/jovyan/ jupyter/tensorflow- notebook:latest $ docker inspect $ docker ps $ docker stop node(or <container id>) $ docker rm node (or <container id>) $ docker rmi (or <image id>) $ docker --help
  • 15. 14 Dockerfile – Linux Example • Instructions on how to build a Docker image • Looks very similar to “native” commands • Important to optimize your Dockerfile
  • 16. Section 2: Anatomy of a Docker Container Docker Volumes Volume Use Cases
  • 17. Let’s Go Back to Our Dockerfile 17
  • 18. Each Dockerfile Command Creates a Layer Kernel FROM 18 RUN WORKDIR COPY EXPOSE …
  • 19. Docker Image Pull: Pulls Layers 19
  • 20. Docker Volumes 20 • Volumes mount a directory on the host into the container at a specific location • Can be used to share (and persist) data between containers • Directory persists after the container is deleted • Unless you explicitly delete it • Can be created in a Dockerfile or via CLI
  • 21. Why Use Volumes 21 • Mount local source code into a running container docker container run -v $(pwd):/usr/src/app/ myapp • Improve performance − As directory structures get complicated traversing the tree can slow system performance • Data persistence
  • 23. What is Docker Bridge Networking Docker host bridgenet1 Cntnr 1 Cntnr 2 Cntnr 3 Docker host bridgenet2 Cntnr 4 Cntnr 5 Cntnr 6 bridgenet3 Cntnr 7 docker network create -d bridge --name bridgenet1 23
  • 24. Docker Bridge Networking and Port Mapping Docker host 1 Bridge Cntnr1 10.0.0.8 L2/L3 physical network :80 :8080 172.14.3.55 $ docker container run -p 8080:80 ... Host port 24 Container port
  • 26. Docker Compose: Multi Container Applications 49 • Build and run one container at a time • Manually connect containers together • Must be careful with dependencies and start up order • Define multi container app in compose.yml file • Single command to deploy entire app • Handles container dependencies • Works with Docker Swarm, Networking, Volumes, Universal Control Plane
  • 27. version: '2' # specify docker-compose version # Define the services/containers to be run services: angular: # name of the first service build: client # specify the directory of the Dockerfile ports: - "4200:4200" # specify port forewarding express: #name of the second service build: api # specify the directory of the Dockerfile ports: - "3977:3977" #specify ports forewarding database: # name of the third service image: mongo # specify image to build container from ports: - "27017:27017" # specify port forewarding Docker Compose: Multi Container Applications
  • 28. Docker images • Docker Hub • Dockerfile
  • 30. Dockerfile • It is possible to build your own images reading instructions from a Dockerfile FROM centos:7 RUN yum install -y python-devel python-virtualenv RUN virtualenv /opt/indico/venv RUN pip install indico COPY entrypoint.sh /opt/indico/entrypoint.sh EXPOSE 8000 ENTRYPOINT /opt/indico/entrypoint.sh
  • 31. docker-compose • Allows to run multi-container Docker applications reading instructions from a docker-compose.yml file version: "2" services: my-application: build: ./ ports: - "8000:8000" environment: - CONFIG_FILE db: image: postgres redis: image: redis command: redis-server --save "" --appendonly no ports: - "6379"