SlideShare una empresa de Scribd logo
1 de 19
Getting started on
Docker and containers
Presentation by - Priyadarshini Anand
Agenda
 Container
 Docker
 Inside container/ outside container
 Container Vs. VM
 Why are docker containers light weight?
 Basics of docker system
 Play with docker commands
 Docker file
Container
 Isolated process(es)
 Runs at native speed straight on host
 Owns process space
 Owns network stack
 Owns root file system
 Owns IPC
 Shares kernal with host
Docker
 A platform for developing, shipping and running applications using container
virtualization technology
 An Open source project to commoditize LinuX Containers
 Allows creation and sharing docker images
 Uses copy-on-write for quick images
 Client/ server architecture
Inside container
 My code
 My Libraries
 My package manager
 My app
 My data
Outside container
 Logging
 Remote access
 Network configuration
 Monitoring
Containers vs. VM
App
A
Hypervisor (Type 2)
Host OS
Server
Gues
t
OS
Bins/
Libs
App
A’
Gues
t
OS
Bins/
Libs
App
B
Gues
t
OS
Bins/
Libs
AppA’
Docker
Host OS
Server
Bins/LibsAppA Bins/Libs
AppB
AppB’
AppB’
AppB’
Container
Containers are isolated,
but share OS and, where
appropriate,
bins/libraries
Gues
t
OS
Gues
t
OS
…result is significantly faster
deployment, much less overhead,
easier migration, faster restart
Why are docker containers light weight?
Original App
(No OS to take
up space, resources,
or require restart)
App
A
Bins/
Libs
App
A’
Gues
t
OS
Bins/
Libs
Modified App
Copy on write
capabilities allow
us to only save the
diffs
Between container A
and container
A’VMs
Every app, every copy of an
app, and every slight modification
of the app requires a new virtual server
App
A
Gues
t
OS
Bins/
Libs
Copy of
App
No OS. Can
Share bins/libs
Bins/
Libs
App
A
App
A
Gues
t
OS
Gues
t
OS
VMs Containers
AppΔBins
Basics of Docker System
Source Code
Repository
Dockerfile
For
A
Docker Engine
Build
Docker
Host 2 OS (Linux)Container
A
Container
B
Container
C
Push
Search
Pull
Run
Host 1 OS
(Linux)
ContainerA
Docker
Container
Image
Registry
Play with docker commands
 Check docker version
#docker version
 List local images
#docker images (latest, tag, local image pulled first)
 List containers
#docker ps
#docker ps –a
 Check logs
#docker logs <container id>
#docker logs –f <container id>
Play with docker commands
 Create container (with terminal/ detached/ with volume/ with port mapping)
Docker run [options] [image] [command] [args]
#docker run ubuntu:14.04 echo “hello world”
#docker run –i –t ubuntu:latest /bin/bash
#docker run –d centos:7 ping 127.0.0.1 –c 50
#docker run –i –t –v /myvolume nginx:1.7
#docker run –d –P tomcat:7
Play with docker commands
Play with docker commands
 Save changes in container as a new image
#docker run –i –t ubuntu:14.04 bash
#root@0c424bc93f0a:/#apt-get install curl
#root@0c424bc93f0a:/#exit
#docker commit 0c424bc93f0a sspt-artifactory.juniper.net/csp-myapp:1.0
#docker images
 Find resource(cpu, memory, io) usage by container
# docker stats –no-stream=true <container-id>
Play with docker commands
 Other useful commands
#docker history [image id]
#docker inspect [container name] | grep IPAddress
#docker start [container short id]
#docker stop [container short id]
#docker exec –i –t [container short id] /bin/bash
#docker rm [container short id]
#docker rmi [image-name:tag/ image id]
#docker save <image-name> > /home/image.tar
#docker load < /home/image.tar
Docker file
 Configuration file that contains instructions for building docker image
 More effective way to build images compared to using “docker commit”
 Easily fits into CI/ CD process
 Use “docker build” command to create image using docker file
 Daemon runs instructions one-by-one, committing the result of each
instruction to a new image, finally outputting the ID of new new image
 ENTRYPOINT instruction inside dockerfile defines command to run when a
container is executed
Dockerfile commands
 FROM
 ADD
 ENTRYPOINT
 ENV
 EXPOSE
 MAINTAINER
 RUN
 USER
 VOLUME
 WORKDIR
# Get base ubuntu image
FROM artifactory.net/my-ubuntu
# Copy installables
COPY client/ /opt/my-service-build/client/
COPY conf/*.conf /etc/my-service/
RUN mkdir /var/log/my-service
RUN 
cd /opt/my-service-build &&
cd core-server &&
pip install --pre -rrequirements.txt -rtest-requirements.txt
&&
pip install my-services -f dist/ &&
RUN chmod +x /my-service-docker-entry.sh
ENTRYPOINT ["/my-service-docker-entry.sh”]
Sample Docker file
Play with Docker file
 Set ENV to set environment variables inside container:
ENV myName="John Doe" myDog=Rex The Dog 
myCat=fluffy
and
ENV myName John Doe
ENV myDog Rex The Dog
ENV myCat fluffy
will yield the same net results in the final container, but the first form is
preferred because it produces a single cache layer.
 Change env variable using command – docker run --env <key>=<value>
Docker Getting Started Guide

Más contenido relacionado

La actualidad más candente

Docker : Container Virtualization
Docker : Container VirtualizationDocker : Container Virtualization
Docker : Container VirtualizationRanjan Baisak
 
Dockerfile Basics | Docker workshop #2 at twitter, 2013-11-05
Dockerfile Basics | Docker workshop #2 at twitter, 2013-11-05Dockerfile Basics | Docker workshop #2 at twitter, 2013-11-05
Dockerfile Basics | Docker workshop #2 at twitter, 2013-11-05dotCloud
 
Docker 101 - Intro to Docker
Docker 101 - Intro to DockerDocker 101 - Intro to Docker
Docker 101 - Intro to DockerAdrian Otto
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to dockerWalid Ashraf
 
Docker introduction for the beginners
Docker introduction for the beginnersDocker introduction for the beginners
Docker introduction for the beginnersJuneyoung Oh
 
Dockerfile basics | docker workshop #1 at Rackspace
Dockerfile basics | docker workshop #1 at RackspaceDockerfile basics | docker workshop #1 at Rackspace
Dockerfile basics | docker workshop #1 at RackspacedotCloud
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to dockerJim Yeh
 
Docker - Getting Started
Docker - Getting StartedDocker - Getting Started
Docker - Getting StartedGaurav Gahlot
 
Docker & JVM: A Perfect Match
Docker & JVM: A Perfect MatchDocker & JVM: A Perfect Match
Docker & JVM: A Perfect MatchMatthias Grüter
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to dockerWei-Ting Kuo
 
Ruby and Docker on Rails
Ruby and Docker on RailsRuby and Docker on Rails
Ruby and Docker on RailsMuriel Salvan
 
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
 

La actualidad más candente (20)

Docker by demo
Docker by demoDocker by demo
Docker by demo
 
Docker Workshop
Docker WorkshopDocker Workshop
Docker Workshop
 
Docker : Container Virtualization
Docker : Container VirtualizationDocker : Container Virtualization
Docker : Container Virtualization
 
Dockerfile Basics | Docker workshop #2 at twitter, 2013-11-05
Dockerfile Basics | Docker workshop #2 at twitter, 2013-11-05Dockerfile Basics | Docker workshop #2 at twitter, 2013-11-05
Dockerfile Basics | Docker workshop #2 at twitter, 2013-11-05
 
Docker 101 - Intro to Docker
Docker 101 - Intro to DockerDocker 101 - Intro to Docker
Docker 101 - Intro to Docker
 
Docker intro
Docker introDocker intro
Docker intro
 
Docker by-demo
Docker by-demoDocker by-demo
Docker by-demo
 
presentation on Docker
presentation on Dockerpresentation on Docker
presentation on Docker
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
Docker introduction for the beginners
Docker introduction for the beginnersDocker introduction for the beginners
Docker introduction for the beginners
 
Dockerfile basics | docker workshop #1 at Rackspace
Dockerfile basics | docker workshop #1 at RackspaceDockerfile basics | docker workshop #1 at Rackspace
Dockerfile basics | docker workshop #1 at Rackspace
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
Docker - Getting Started
Docker - Getting StartedDocker - Getting Started
Docker - Getting Started
 
Docker & JVM: A Perfect Match
Docker & JVM: A Perfect MatchDocker & JVM: A Perfect Match
Docker & JVM: A Perfect Match
 
Docker & ci
Docker & ciDocker & ci
Docker & ci
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
Docker
DockerDocker
Docker
 
Ruby and Docker on Rails
Ruby and Docker on RailsRuby and Docker on Rails
Ruby and Docker on Rails
 
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...
 

Similar a Docker Getting Started Guide

Develop with docker 2014 aug
Develop with docker 2014 augDevelop with docker 2014 aug
Develop with docker 2014 augVincent De Smet
 
Deploying .net core apps to Docker - dotnetConf Local Bengaluru
Deploying .net core apps to Docker - dotnetConf Local BengaluruDeploying .net core apps to Docker - dotnetConf Local Bengaluru
Deploying .net core apps to Docker - dotnetConf Local BengaluruSwaminathan Vetri
 
Docker for developers z java
Docker for developers z javaDocker for developers z java
Docker for developers z javaandrzejsydor
 
Hands on introduction to docker security for docker newbies
Hands on introduction to docker security for docker newbiesHands on introduction to docker security for docker newbies
Hands on introduction to docker security for docker newbiesYigal Elefant
 
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
 
Docker for .NET Developers
Docker for .NET DevelopersDocker for .NET Developers
Docker for .NET DevelopersTaswar Bhatti
 
Dockers & kubernetes detailed - Beginners to Geek
Dockers & kubernetes detailed - Beginners to GeekDockers & kubernetes detailed - Beginners to Geek
Dockers & kubernetes detailed - Beginners to GeekwiTTyMinds1
 
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
 
Dockerizing a Symfony2 application
Dockerizing a Symfony2 applicationDockerizing a Symfony2 application
Dockerizing a Symfony2 applicationRoman Rodomansky
 
containers and virtualization tools ( Docker )
containers and virtualization tools ( Docker )containers and virtualization tools ( Docker )
containers and virtualization tools ( Docker )Imo Inyang
 
[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안양재동 코드랩
 
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...Codemotion
 
Docker - The Linux Container
Docker - The Linux ContainerDocker - The Linux Container
Docker - The Linux ContainerBalaji Rajan
 
PuppetConf 2017: What’s in the Box?!- Leveraging Puppet Enterprise & Docker- ...
PuppetConf 2017: What’s in the Box?!- Leveraging Puppet Enterprise & Docker- ...PuppetConf 2017: What’s in the Box?!- Leveraging Puppet Enterprise & Docker- ...
PuppetConf 2017: What’s in the Box?!- Leveraging Puppet Enterprise & Docker- ...Puppet
 

Similar a Docker Getting Started Guide (20)

Docker
DockerDocker
Docker
 
Docker Ecosystem on Azure
Docker Ecosystem on AzureDocker Ecosystem on Azure
Docker Ecosystem on Azure
 
Develop with docker 2014 aug
Develop with docker 2014 augDevelop with docker 2014 aug
Develop with docker 2014 aug
 
Deploying .net core apps to Docker - dotnetConf Local Bengaluru
Deploying .net core apps to Docker - dotnetConf Local BengaluruDeploying .net core apps to Docker - dotnetConf Local Bengaluru
Deploying .net core apps to Docker - dotnetConf Local Bengaluru
 
Docker for developers z java
Docker for developers z javaDocker for developers z java
Docker for developers z java
 
Hands on introduction to docker security for docker newbies
Hands on introduction to docker security for docker newbiesHands on introduction to docker security for docker newbies
Hands on introduction to docker security for docker newbies
 
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 for .NET Developers
Docker for .NET DevelopersDocker for .NET Developers
Docker for .NET Developers
 
Dockers & kubernetes detailed - Beginners to Geek
Dockers & kubernetes detailed - Beginners to GeekDockers & kubernetes detailed - Beginners to Geek
Dockers & kubernetes detailed - Beginners to Geek
 
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 for Developers
Docker for DevelopersDocker for Developers
Docker for Developers
 
Dockerizing a Symfony2 application
Dockerizing a Symfony2 applicationDockerizing a Symfony2 application
Dockerizing a Symfony2 application
 
containers and virtualization tools ( Docker )
containers and virtualization tools ( Docker )containers and virtualization tools ( Docker )
containers and virtualization tools ( Docker )
 
[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안
 
How to _docker
How to _dockerHow to _docker
How to _docker
 
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
 
Docker, LinuX Container
Docker, LinuX ContainerDocker, LinuX Container
Docker, LinuX Container
 
Docker - The Linux Container
Docker - The Linux ContainerDocker - The Linux Container
Docker - The Linux Container
 
Docker basics
Docker basicsDocker basics
Docker basics
 
PuppetConf 2017: What’s in the Box?!- Leveraging Puppet Enterprise & Docker- ...
PuppetConf 2017: What’s in the Box?!- Leveraging Puppet Enterprise & Docker- ...PuppetConf 2017: What’s in the Box?!- Leveraging Puppet Enterprise & Docker- ...
PuppetConf 2017: What’s in the Box?!- Leveraging Puppet Enterprise & Docker- ...
 

Último

Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 

Último (20)

Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 

Docker Getting Started Guide

  • 1. Getting started on Docker and containers Presentation by - Priyadarshini Anand
  • 2. Agenda  Container  Docker  Inside container/ outside container  Container Vs. VM  Why are docker containers light weight?  Basics of docker system  Play with docker commands  Docker file
  • 3. Container  Isolated process(es)  Runs at native speed straight on host  Owns process space  Owns network stack  Owns root file system  Owns IPC  Shares kernal with host
  • 4. Docker  A platform for developing, shipping and running applications using container virtualization technology  An Open source project to commoditize LinuX Containers  Allows creation and sharing docker images  Uses copy-on-write for quick images  Client/ server architecture
  • 5. Inside container  My code  My Libraries  My package manager  My app  My data Outside container  Logging  Remote access  Network configuration  Monitoring
  • 6. Containers vs. VM App A Hypervisor (Type 2) Host OS Server Gues t OS Bins/ Libs App A’ Gues t OS Bins/ Libs App B Gues t OS Bins/ Libs AppA’ Docker Host OS Server Bins/LibsAppA Bins/Libs AppB AppB’ AppB’ AppB’ Container Containers are isolated, but share OS and, where appropriate, bins/libraries Gues t OS Gues t OS …result is significantly faster deployment, much less overhead, easier migration, faster restart
  • 7. Why are docker containers light weight? Original App (No OS to take up space, resources, or require restart) App A Bins/ Libs App A’ Gues t OS Bins/ Libs Modified App Copy on write capabilities allow us to only save the diffs Between container A and container A’VMs Every app, every copy of an app, and every slight modification of the app requires a new virtual server App A Gues t OS Bins/ Libs Copy of App No OS. Can Share bins/libs Bins/ Libs App A App A Gues t OS Gues t OS VMs Containers AppΔBins
  • 8. Basics of Docker System Source Code Repository Dockerfile For A Docker Engine Build Docker Host 2 OS (Linux)Container A Container B Container C Push Search Pull Run Host 1 OS (Linux) ContainerA Docker Container Image Registry
  • 9. Play with docker commands  Check docker version #docker version  List local images #docker images (latest, tag, local image pulled first)  List containers #docker ps #docker ps –a  Check logs #docker logs <container id> #docker logs –f <container id>
  • 10. Play with docker commands  Create container (with terminal/ detached/ with volume/ with port mapping) Docker run [options] [image] [command] [args] #docker run ubuntu:14.04 echo “hello world” #docker run –i –t ubuntu:latest /bin/bash #docker run –d centos:7 ping 127.0.0.1 –c 50 #docker run –i –t –v /myvolume nginx:1.7 #docker run –d –P tomcat:7
  • 11. Play with docker commands
  • 12.
  • 13. Play with docker commands  Save changes in container as a new image #docker run –i –t ubuntu:14.04 bash #root@0c424bc93f0a:/#apt-get install curl #root@0c424bc93f0a:/#exit #docker commit 0c424bc93f0a sspt-artifactory.juniper.net/csp-myapp:1.0 #docker images  Find resource(cpu, memory, io) usage by container # docker stats –no-stream=true <container-id>
  • 14. Play with docker commands  Other useful commands #docker history [image id] #docker inspect [container name] | grep IPAddress #docker start [container short id] #docker stop [container short id] #docker exec –i –t [container short id] /bin/bash #docker rm [container short id] #docker rmi [image-name:tag/ image id] #docker save <image-name> > /home/image.tar #docker load < /home/image.tar
  • 15. Docker file  Configuration file that contains instructions for building docker image  More effective way to build images compared to using “docker commit”  Easily fits into CI/ CD process  Use “docker build” command to create image using docker file  Daemon runs instructions one-by-one, committing the result of each instruction to a new image, finally outputting the ID of new new image  ENTRYPOINT instruction inside dockerfile defines command to run when a container is executed
  • 16. Dockerfile commands  FROM  ADD  ENTRYPOINT  ENV  EXPOSE  MAINTAINER  RUN  USER  VOLUME  WORKDIR
  • 17. # Get base ubuntu image FROM artifactory.net/my-ubuntu # Copy installables COPY client/ /opt/my-service-build/client/ COPY conf/*.conf /etc/my-service/ RUN mkdir /var/log/my-service RUN cd /opt/my-service-build && cd core-server && pip install --pre -rrequirements.txt -rtest-requirements.txt && pip install my-services -f dist/ && RUN chmod +x /my-service-docker-entry.sh ENTRYPOINT ["/my-service-docker-entry.sh”] Sample Docker file
  • 18. Play with Docker file  Set ENV to set environment variables inside container: ENV myName="John Doe" myDog=Rex The Dog myCat=fluffy and ENV myName John Doe ENV myDog Rex The Dog ENV myCat fluffy will yield the same net results in the final container, but the first form is preferred because it produces a single cache layer.  Change env variable using command – docker run --env <key>=<value>

Notas del editor

  1. Docker: Make containers very very easy to use the Docker daemon runs in the background – manages containers, images, and builds – HTTP API (over UNIX or TCP socket) – embedded CLI talking to the API libvirt: Platform Virtualization LXC (LinuX Containers): Multiple isolated Linux systems (containers) on a single host Layered File System
  2. Client takes user inputs and send them to the daemon Daemon builds, runs and distribute containers Client and daemon can run on the same host or on different hosts Benefits of docker: Application portability Scalability Resource optimization Better security as provides reduced set of default privileges and capabilities
  3. VM: Host OS manages the physical HW and provides multiple virtual HW that can run different operating systems on a single physical server. It does this by emulating the HW and the guest OS is not aware it is running on a physical platform or virtual platform. Virtual HW that can run unmodified guest operating system is called full virtualization. As HW emulation is expensive, for efficiency the guest OS drivers are modified to effectively share the physical HW and this form of virtualization is called para-virtualization. Container It runs a single OS and the OS provide isolation using name spaces. In container all applications run as processes within the container. This provides another level of security and processes running in a container don’t see or have access to other containers. To run applications built for other operating systems, container needs a simulated environment with a set of libraries and resources such file systems, networking support. Docker uses the container technology and provides the environment needed to support. Virtual machines emulate the hardware and provide virtual platforms that can run unmodified SW including kernel. In environment where the kernel is heavily modified to fit the needs of the applications for efficiency and other reasons additional work is required to run these applications in the container based environment. Otherwise container based technology offers better resource utilization. Virtual machines use the Hardware provided isolation in most cases and container uses the name spaces to provide the isolation. A namespace wraps a global system resource in an abstraction that makes it appear to the processes within the namespace that they have their own isolated instance of the global resource. Changes to the global resource are visible to other processes that are members of the namespace, but are invisible to other processes. One use of namespaces is to implement containers. Linux provides the following namespaces: Namespace Constant Isolates Cgroup CLONE_NEWCGROUP Cgroup root directory IPC CLONE_NEWIPC System V IPC, POSIX message queues Network CLONE_NEWNET Network devices, stacks, ports, etc. Mount CLONE_NEWNS Mount points PID CLONE_NEWPID Process IDs User CLONE_NEWUSER User and group IDs UTS CLONE_NEWUTS Hostname and NIS domain name
  4. Docker hub is public registry that contains a large number of images available for use
  5. Container runs as long as the process from specified docker run command is running Command’s process is always PID 1 inside the container Container has long ID and short ID. Docker ps command to get short ID and name Give absolute path while mounting volume
  6. Execute to start another process within a container, exiting from this terminal will not terminate container