SlideShare a Scribd company logo
Docker Tech Talk with Demo
Docker Tech Talk
1
Sandeep Karnawat
Principal S/W Engineer
Sample Agenda
1 Docker Background
2 How to Use Docker
3 Docker Inside
4 Docker Demo
Docker Tech Talk
2
What is docker?
• Docker is:
– An open platform for developers and sysadmins to develop, ship, and run
distributed applications [docker.io]
– An open-source project that automates the deployment of applications
inside software containers by providing an additional layer of abstraction
and automation of operating system-level virtualization on Linux
[Wikipedia]
– A tool that can package an application and its dependencies in a virtual
container that can run on any Linux server [451 Research]
Docker Tech Talk
3
How is it different from VM?
Docker Tech Talk
4
What does Docker look like?
• Docker is a client-server application.
– Docker client and the daemon can run on the same system, or on different
machines
– They communicate via sockets (or through a RESTful API).
– Users interact with the client to command the daemon
– The daemon, receiving those commands, does the job
Docker Tech Talk
5
Sample Agenda
1 Docker Background
2 How to Use Docker
3 Docker Inside
4 Docker Application
Docker Tech Talk
6
How to download a docker image
• docker pull <image_name>
– Pull: fetch the image from the Docker Hub Registry
(registry.hub.docker.com)
– Image_name: usually consist of user_name/image_name
– E.g., sudo docker pull skarnawat/mytest_docker
Docker Tech Talk
7
How to launch a docker container
• docker run –it <image_name> [command_name]
– Option –t: allocate pseudo-terminal
– Option –i: interactive mode
– Eg: docker run –it mingwei/mytest_docker bash
– Note: when you run “bash” option -i and –t are both needed
– When you do not need “terminal”; use “–d” instead of “-it”
• Where is my container?
– docker ps
– docker ps –a (all containers you have run)
• How can I name my own container?
– docker run –it –n mycontainer mingwei/mytest_docker bash
Docker Tech Talk
8
How to generate a new image?
• Manually Create Image
– A container is a running instance of an image
– When all processes inside container exit, container is stopped
– One way to create a new image:
• Create a new container using “docker run –it <image> bash”
• Issue commands: “apt-get install <software>”
• Transform your container to an image:
– docker commit <your_container_name> <your_new_image_name>
– What if I didn’t name my container?
• Use the automatically assigned container id instead.
• Container id could be found using “docker ps “
Docker Tech Talk
9
How to generate your own image
• Dockerfile
– Like a makefile, you use it to automate the building of an image:
• docker build –t <your_img_name> .
• Your image is built using the Dockerfile in current directory
• Docker file contains a sequence of commands
– Inside Dockerfile:
• Updates will be applied to new image
• FROM: base image you specify
• RUN: run a command inside container
• ADD: copy files into new image
– Note: tar, gzip bzip2 and etc will be decompressed
• Other Directives:
– http://docs.docker.com/reference/builder/
Docker Tech Talk
10
From ubuntu:14.04
Author: skarnawat
RUN apt-get install binutils
ADD myfile.tar /app
VOLUME [“/yourdata”]
…
Docker Tech Talk
11
Login to Existing Container
• You can’t login to an existing container, if
– The container does not have terminal (launched with –d but not –it)
– E.g., docker run –d skdocker/apache apache2ctl -D FOREGROUND
• Option1: sshd server
– Using a sshd, you could login to existing container
– Issues: manage passwords, keys
• Option2: use docker attach
– Docker attach <container_name>
Docker Tech Talk
12
Docker Tech Talk
13
Docker: Under the Hood
Implementation and Details
Docker Container Implementation
• Namespaces
– Docker takes advantage of a technology called namespaces to provide the
isolated workspace we call the container.
– One container cannot see names in another container’s namespace
– The pid namespace: virtualized process names (PID: Process ID).
– The net namespace: virtualized network interfaces, routing tables, etc.
(NET: Networking).
– The mnt namespace: virtualized file system mount points (MNT: Mount).
Docker Tech Talk
14
Linux Container Implementation
• Namespaces
• Control groups
– provide a mechanism for performance isolation
– Cgroup allows you to control the resource usage of:
• CPUSET and CPU USAGE
• Memory
• Disk I/O
• Device visibility
– Cgroup is maintained as a virtual file system (like proc): cgroupfs
Docker Tech Talk
15
Your diff
(rw)
Your
view
image #1
Base image
(readonly)
File System (AUFS)
• AUFS: advanced union file system
– Union of all images
– Less storage
– Maximum layers 127
Docker Tech Talk
16
image #2
Your diff
(rw)
Your diff
(ro)
Your diff
(rw)
Your diff
(ro)
Docker and LXC
• Docker containers are in linux
container format.
Docker Tech Talk
17
Comparison
Docker
• Application container
– Only application process is running
• Ship with file system support
• Use cgroups and namespace
• Has docker image repository
• Support versioning and commit
• Has API support
• Support SELinux and Apparmor
LXC
• Light weight virtual machine
– A set of system daemons are running
• User need to config their file system
• Use cgroups and namespace
• No repository support (can’t move!)
• No support on image version
• No API, only configuration
• Support SELinux and Apparmor
Docker Tech Talk
18
It is still unclear which style of containers will win in the future
Docker Start-up Process
• Command: docker run –it ubuntu bash
• What happened?
– Mount aufs (all diffs)
• Transform image name to ID
• Get all diffs required and merge them
– Prepare cgroup file system
– Launch container process (using clone)
• Clone(2) specify using new namespace
• Exec docerinit (launch docker binary)
• Prepare other file systems
– Devfs, tmpfs, proc and etc
– Symlinks for standard I/O
• Change root file system (pivot_root)
• Drop capabilities
– Capget(2)
– Prctl(PR_CAPBSET_DROP, 0x.., 0, 0, 0)
Docker Tech Talk
19
Base image
Base image
(readonly)
Diff (ro)
Diff (ro)
Diff (ro)
Diff (ro)
Diff (ro)
/var/lib/docker/aufs/diff/ID:
/var/lib/docker/aufs/mnt/Container_ID:
Docker Start-up Process
• Command: Docker run –it ubuntu bash
• What happened?
– Mount aufs (all diffs)
– Prepare cgroup (resource management)
– Launch container process (using clone)
• Clone(2) specify using new namespace
• Exec docerinit (launch docker binary)
• Prepare other file systems
– Devfs, tmpfs, proc and etc
– Symlinks for standard I/O and etc
Docker Tech Talk
20
Container File System View
base=/var/lib/docker/aufs/mnt/Container_ID:
$base/dev
$base/etc/hostname
$base/etc/resolv.conf
$base/etc/hosts
$base/proc/proc/fd/0
Docker Start-up Process
• Command: Docker run –it ubuntu bash
• What happened?
– Mount aufs (all diffs)
– Prepare cgroup (resource management)
– Launch container process (using clone)
• Clone(2) specify using new namespace
• Exec docerinit (launch docker binary)
• Prepare other file systems
– Devfs, tmpfs, proc and etc
– Symlinks for standard I/O
• Change root file system (pivot_root)
Docker Tech Talk
2121
Container File System View
base=/var/lib/docker/aufs/mnt/Container_ID:
/dev
/etc/hostname
/etc/resolv.conf
/etc/hosts
/proc
Sample Agenda
1 Docker Background
2 How to Use Docker
3 Docker Inside
4 Docker Demo
Docker Tech Talk
22
Thank You!
Docker Tech Talk
23
Karnawat.sk@gamil.com
https://in.linkedin.com/in/sandeepkarnawat

More Related Content

What's hot

Docker 101 - Intro to Docker
Docker 101 - Intro to DockerDocker 101 - Intro to Docker
Docker 101 - Intro to Docker
Adrian Otto
 
Docker_AGH_v0.1.3
Docker_AGH_v0.1.3Docker_AGH_v0.1.3
Docker_AGH_v0.1.3
Witold 'Ficio' Kopel
 
Docker puebla bday #4 celebration
Docker puebla bday #4 celebrationDocker puebla bday #4 celebration
Docker puebla bday #4 celebration
Ramon Morales
 
Lxc – next gen virtualization for cloud intro (cloudexpo)
Lxc – next gen virtualization for cloud   intro (cloudexpo)Lxc – next gen virtualization for cloud   intro (cloudexpo)
Lxc – next gen virtualization for cloud intro (cloudexpo)
Boden Russell
 
Docker and kubernetes
Docker and kubernetesDocker and kubernetes
Docker and kubernetes
Meiyappan Kannappa
 
Lightweight Virtualization: LXC containers & AUFS
Lightweight Virtualization: LXC containers & AUFSLightweight Virtualization: LXC containers & AUFS
Lightweight Virtualization: LXC containers & AUFS
Jérôme Petazzoni
 
Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...
Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...
Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...
Jérôme Petazzoni
 
Linux containers – next gen virtualization for cloud (atl summit) ar4 3 - copy
Linux containers – next gen virtualization for cloud (atl summit) ar4 3 - copyLinux containers – next gen virtualization for cloud (atl summit) ar4 3 - copy
Linux containers – next gen virtualization for cloud (atl summit) ar4 3 - copy
Boden Russell
 
Docker Internals - Twilio talk November 14th, 2013
Docker Internals - Twilio talk November 14th, 2013Docker Internals - Twilio talk November 14th, 2013
Docker Internals - Twilio talk November 14th, 2013
Guillaume Charmes
 
Kernel linux lab manual feb (1)
Kernel linux lab manual feb (1)Kernel linux lab manual feb (1)
Kernel linux lab manual feb (1)
johny shaik
 
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxConAnatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
Jérôme Petazzoni
 
LXC, Docker, and the future of software delivery | LinuxCon 2013
LXC, Docker, and the future of software delivery | LinuxCon 2013LXC, Docker, and the future of software delivery | LinuxCon 2013
LXC, Docker, and the future of software delivery | LinuxCon 2013
dotCloud
 
Docker internals
Docker internalsDocker internals
Docker internals
Rohit Jnagal
 
Docker 활용법: dumpdocker
Docker 활용법: dumpdockerDocker 활용법: dumpdocker
Docker 활용법: dumpdocker
Jaehwa Park
 
How to _docker
How to _dockerHow to _docker
How to _docker
Abdur Rab Marjan
 
Academy PRO: Docker. Part 2
Academy PRO: Docker. Part 2Academy PRO: Docker. Part 2
Academy PRO: Docker. Part 2
Binary Studio
 
Docker by Example - Quiz
Docker by Example - QuizDocker by Example - Quiz
Docker by Example - Quiz
CodeOps Technologies LLP
 
Academy PRO: Docker. Part 4
Academy PRO: Docker. Part 4Academy PRO: Docker. Part 4
Academy PRO: Docker. Part 4
Binary Studio
 
A Hands-on Introduction to Docker
A Hands-on Introduction to DockerA Hands-on Introduction to Docker
A Hands-on Introduction to Docker
CodeOps Technologies LLP
 
Docker, Linux Containers (LXC), and security
Docker, Linux Containers (LXC), and securityDocker, Linux Containers (LXC), and security
Docker, Linux Containers (LXC), and security
Jérôme Petazzoni
 

What's hot (20)

Docker 101 - Intro to Docker
Docker 101 - Intro to DockerDocker 101 - Intro to Docker
Docker 101 - Intro to Docker
 
Docker_AGH_v0.1.3
Docker_AGH_v0.1.3Docker_AGH_v0.1.3
Docker_AGH_v0.1.3
 
Docker puebla bday #4 celebration
Docker puebla bday #4 celebrationDocker puebla bday #4 celebration
Docker puebla bday #4 celebration
 
Lxc – next gen virtualization for cloud intro (cloudexpo)
Lxc – next gen virtualization for cloud   intro (cloudexpo)Lxc – next gen virtualization for cloud   intro (cloudexpo)
Lxc – next gen virtualization for cloud intro (cloudexpo)
 
Docker and kubernetes
Docker and kubernetesDocker and kubernetes
Docker and kubernetes
 
Lightweight Virtualization: LXC containers & AUFS
Lightweight Virtualization: LXC containers & AUFSLightweight Virtualization: LXC containers & AUFS
Lightweight Virtualization: LXC containers & AUFS
 
Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...
Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...
Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...
 
Linux containers – next gen virtualization for cloud (atl summit) ar4 3 - copy
Linux containers – next gen virtualization for cloud (atl summit) ar4 3 - copyLinux containers – next gen virtualization for cloud (atl summit) ar4 3 - copy
Linux containers – next gen virtualization for cloud (atl summit) ar4 3 - copy
 
Docker Internals - Twilio talk November 14th, 2013
Docker Internals - Twilio talk November 14th, 2013Docker Internals - Twilio talk November 14th, 2013
Docker Internals - Twilio talk November 14th, 2013
 
Kernel linux lab manual feb (1)
Kernel linux lab manual feb (1)Kernel linux lab manual feb (1)
Kernel linux lab manual feb (1)
 
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxConAnatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
 
LXC, Docker, and the future of software delivery | LinuxCon 2013
LXC, Docker, and the future of software delivery | LinuxCon 2013LXC, Docker, and the future of software delivery | LinuxCon 2013
LXC, Docker, and the future of software delivery | LinuxCon 2013
 
Docker internals
Docker internalsDocker internals
Docker internals
 
Docker 활용법: dumpdocker
Docker 활용법: dumpdockerDocker 활용법: dumpdocker
Docker 활용법: dumpdocker
 
How to _docker
How to _dockerHow to _docker
How to _docker
 
Academy PRO: Docker. Part 2
Academy PRO: Docker. Part 2Academy PRO: Docker. Part 2
Academy PRO: Docker. Part 2
 
Docker by Example - Quiz
Docker by Example - QuizDocker by Example - Quiz
Docker by Example - Quiz
 
Academy PRO: Docker. Part 4
Academy PRO: Docker. Part 4Academy PRO: Docker. Part 4
Academy PRO: Docker. Part 4
 
A Hands-on Introduction to Docker
A Hands-on Introduction to DockerA Hands-on Introduction to Docker
A Hands-on Introduction to Docker
 
Docker, Linux Containers (LXC), and security
Docker, Linux Containers (LXC), and securityDocker, Linux Containers (LXC), and security
Docker, Linux Containers (LXC), and security
 

Similar to Tech talk on docker with demo

Powercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptxPowercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptx
IgnacioTamayo2
 
ExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ExpoQA 2017 Using docker to build and test in your laptop and JenkinsExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ElasTest Project
 
Docker Ecosystem on Azure
Docker Ecosystem on AzureDocker Ecosystem on Azure
Docker Ecosystem on Azure
Patrick Chanezon
 
Dockerizing a Symfony2 application
Dockerizing a Symfony2 applicationDockerizing a Symfony2 application
Dockerizing a Symfony2 application
Roman Rodomansky
 
Docker
DockerDocker
Using Docker with OpenStack - Hands On!
 Using Docker with OpenStack - Hands On! Using Docker with OpenStack - Hands On!
Using Docker with OpenStack - Hands On!
Adrian Otto
 
presentation on Docker
presentation on Dockerpresentation on Docker
presentation on Docker
Virendra Ruhela
 
Containerization using docker and its applications
Containerization using docker and its applicationsContainerization using docker and its applications
Containerization using docker and its applications
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
Containerization using docker and its applications
Containerization using docker and its applicationsContainerization using docker and its applications
Containerization using docker and its applications
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
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
Guido Schmutz
 
Docker, but what it is?
Docker, but what it is?Docker, but what it is?
Docker, but what it is?
Julien Maitrehenry
 
Docker 2014
Docker 2014Docker 2014
Docker and the Container Ecosystem
Docker and the Container EcosystemDocker and the Container Ecosystem
Docker and the Container Ecosystem
psconnolly
 
Docker and kubernetes
Docker and kubernetesDocker and kubernetes
Docker and kubernetes
Dongwon Kim
 
Docker.ppt
Docker.pptDocker.ppt
Docker.ppt
Ajit Mali
 
Developer workflow with docker
Developer workflow with dockerDeveloper workflow with docker
Developer workflow with docker
Wyn B. Van Devanter
 
Docker from A to Z, including Swarm and OCCS
Docker from A to Z, including Swarm and OCCSDocker from A to Z, including Swarm and OCCS
Docker from A to Z, including Swarm and OCCS
Frank Munz
 
Docker 1.9 Workshop
Docker 1.9 WorkshopDocker 1.9 Workshop
Docker 1.9 Workshop
{code}
 
Docker, LinuX Container
Docker, LinuX ContainerDocker, LinuX Container
Docker, LinuX Container
Araf Karsh Hamid
 
Docker
DockerDocker

Similar to Tech talk on docker with demo (20)

Powercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptxPowercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptx
 
ExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ExpoQA 2017 Using docker to build and test in your laptop and JenkinsExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ExpoQA 2017 Using docker to build and test in your laptop and Jenkins
 
Docker Ecosystem on Azure
Docker Ecosystem on AzureDocker Ecosystem on Azure
Docker Ecosystem on Azure
 
Dockerizing a Symfony2 application
Dockerizing a Symfony2 applicationDockerizing a Symfony2 application
Dockerizing a Symfony2 application
 
Docker
DockerDocker
Docker
 
Using Docker with OpenStack - Hands On!
 Using Docker with OpenStack - Hands On! Using Docker with OpenStack - Hands On!
Using Docker with OpenStack - Hands On!
 
presentation on Docker
presentation on Dockerpresentation on Docker
presentation on Docker
 
Containerization using docker and its applications
Containerization using docker and its applicationsContainerization using docker and its applications
Containerization using docker and its applications
 
Containerization using docker and its applications
Containerization using docker and its applicationsContainerization using docker and its applications
Containerization using docker and its applications
 
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, but what it is?
Docker, but what it is?Docker, but what it is?
Docker, but what it is?
 
Docker 2014
Docker 2014Docker 2014
Docker 2014
 
Docker and the Container Ecosystem
Docker and the Container EcosystemDocker and the Container Ecosystem
Docker and the Container Ecosystem
 
Docker and kubernetes
Docker and kubernetesDocker and kubernetes
Docker and kubernetes
 
Docker.ppt
Docker.pptDocker.ppt
Docker.ppt
 
Developer workflow with docker
Developer workflow with dockerDeveloper workflow with docker
Developer workflow with docker
 
Docker from A to Z, including Swarm and OCCS
Docker from A to Z, including Swarm and OCCSDocker from A to Z, including Swarm and OCCS
Docker from A to Z, including Swarm and OCCS
 
Docker 1.9 Workshop
Docker 1.9 WorkshopDocker 1.9 Workshop
Docker 1.9 Workshop
 
Docker, LinuX Container
Docker, LinuX ContainerDocker, LinuX Container
Docker, LinuX Container
 
Docker
DockerDocker
Docker
 

Recently uploaded

Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Precisely
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
ScyllaDB
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
HarisZaheer8
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
Shinana2
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Tatiana Kojar
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
Edge AI and Vision Alliance
 

Recently uploaded (20)

Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
 

Tech talk on docker with demo

  • 1. Docker Tech Talk with Demo Docker Tech Talk 1 Sandeep Karnawat Principal S/W Engineer
  • 2. Sample Agenda 1 Docker Background 2 How to Use Docker 3 Docker Inside 4 Docker Demo Docker Tech Talk 2
  • 3. What is docker? • Docker is: – An open platform for developers and sysadmins to develop, ship, and run distributed applications [docker.io] – An open-source project that automates the deployment of applications inside software containers by providing an additional layer of abstraction and automation of operating system-level virtualization on Linux [Wikipedia] – A tool that can package an application and its dependencies in a virtual container that can run on any Linux server [451 Research] Docker Tech Talk 3
  • 4. How is it different from VM? Docker Tech Talk 4
  • 5. What does Docker look like? • Docker is a client-server application. – Docker client and the daemon can run on the same system, or on different machines – They communicate via sockets (or through a RESTful API). – Users interact with the client to command the daemon – The daemon, receiving those commands, does the job Docker Tech Talk 5
  • 6. Sample Agenda 1 Docker Background 2 How to Use Docker 3 Docker Inside 4 Docker Application Docker Tech Talk 6
  • 7. How to download a docker image • docker pull <image_name> – Pull: fetch the image from the Docker Hub Registry (registry.hub.docker.com) – Image_name: usually consist of user_name/image_name – E.g., sudo docker pull skarnawat/mytest_docker Docker Tech Talk 7
  • 8. How to launch a docker container • docker run –it <image_name> [command_name] – Option –t: allocate pseudo-terminal – Option –i: interactive mode – Eg: docker run –it mingwei/mytest_docker bash – Note: when you run “bash” option -i and –t are both needed – When you do not need “terminal”; use “–d” instead of “-it” • Where is my container? – docker ps – docker ps –a (all containers you have run) • How can I name my own container? – docker run –it –n mycontainer mingwei/mytest_docker bash Docker Tech Talk 8
  • 9. How to generate a new image? • Manually Create Image – A container is a running instance of an image – When all processes inside container exit, container is stopped – One way to create a new image: • Create a new container using “docker run –it <image> bash” • Issue commands: “apt-get install <software>” • Transform your container to an image: – docker commit <your_container_name> <your_new_image_name> – What if I didn’t name my container? • Use the automatically assigned container id instead. • Container id could be found using “docker ps “ Docker Tech Talk 9
  • 10. How to generate your own image • Dockerfile – Like a makefile, you use it to automate the building of an image: • docker build –t <your_img_name> . • Your image is built using the Dockerfile in current directory • Docker file contains a sequence of commands – Inside Dockerfile: • Updates will be applied to new image • FROM: base image you specify • RUN: run a command inside container • ADD: copy files into new image – Note: tar, gzip bzip2 and etc will be decompressed • Other Directives: – http://docs.docker.com/reference/builder/ Docker Tech Talk 10 From ubuntu:14.04 Author: skarnawat RUN apt-get install binutils ADD myfile.tar /app VOLUME [“/yourdata”] …
  • 12. Login to Existing Container • You can’t login to an existing container, if – The container does not have terminal (launched with –d but not –it) – E.g., docker run –d skdocker/apache apache2ctl -D FOREGROUND • Option1: sshd server – Using a sshd, you could login to existing container – Issues: manage passwords, keys • Option2: use docker attach – Docker attach <container_name> Docker Tech Talk 12
  • 13. Docker Tech Talk 13 Docker: Under the Hood Implementation and Details
  • 14. Docker Container Implementation • Namespaces – Docker takes advantage of a technology called namespaces to provide the isolated workspace we call the container. – One container cannot see names in another container’s namespace – The pid namespace: virtualized process names (PID: Process ID). – The net namespace: virtualized network interfaces, routing tables, etc. (NET: Networking). – The mnt namespace: virtualized file system mount points (MNT: Mount). Docker Tech Talk 14
  • 15. Linux Container Implementation • Namespaces • Control groups – provide a mechanism for performance isolation – Cgroup allows you to control the resource usage of: • CPUSET and CPU USAGE • Memory • Disk I/O • Device visibility – Cgroup is maintained as a virtual file system (like proc): cgroupfs Docker Tech Talk 15
  • 16. Your diff (rw) Your view image #1 Base image (readonly) File System (AUFS) • AUFS: advanced union file system – Union of all images – Less storage – Maximum layers 127 Docker Tech Talk 16 image #2 Your diff (rw) Your diff (ro) Your diff (rw) Your diff (ro)
  • 17. Docker and LXC • Docker containers are in linux container format. Docker Tech Talk 17
  • 18. Comparison Docker • Application container – Only application process is running • Ship with file system support • Use cgroups and namespace • Has docker image repository • Support versioning and commit • Has API support • Support SELinux and Apparmor LXC • Light weight virtual machine – A set of system daemons are running • User need to config their file system • Use cgroups and namespace • No repository support (can’t move!) • No support on image version • No API, only configuration • Support SELinux and Apparmor Docker Tech Talk 18 It is still unclear which style of containers will win in the future
  • 19. Docker Start-up Process • Command: docker run –it ubuntu bash • What happened? – Mount aufs (all diffs) • Transform image name to ID • Get all diffs required and merge them – Prepare cgroup file system – Launch container process (using clone) • Clone(2) specify using new namespace • Exec docerinit (launch docker binary) • Prepare other file systems – Devfs, tmpfs, proc and etc – Symlinks for standard I/O • Change root file system (pivot_root) • Drop capabilities – Capget(2) – Prctl(PR_CAPBSET_DROP, 0x.., 0, 0, 0) Docker Tech Talk 19 Base image Base image (readonly) Diff (ro) Diff (ro) Diff (ro) Diff (ro) Diff (ro) /var/lib/docker/aufs/diff/ID: /var/lib/docker/aufs/mnt/Container_ID:
  • 20. Docker Start-up Process • Command: Docker run –it ubuntu bash • What happened? – Mount aufs (all diffs) – Prepare cgroup (resource management) – Launch container process (using clone) • Clone(2) specify using new namespace • Exec docerinit (launch docker binary) • Prepare other file systems – Devfs, tmpfs, proc and etc – Symlinks for standard I/O and etc Docker Tech Talk 20 Container File System View base=/var/lib/docker/aufs/mnt/Container_ID: $base/dev $base/etc/hostname $base/etc/resolv.conf $base/etc/hosts $base/proc/proc/fd/0
  • 21. Docker Start-up Process • Command: Docker run –it ubuntu bash • What happened? – Mount aufs (all diffs) – Prepare cgroup (resource management) – Launch container process (using clone) • Clone(2) specify using new namespace • Exec docerinit (launch docker binary) • Prepare other file systems – Devfs, tmpfs, proc and etc – Symlinks for standard I/O • Change root file system (pivot_root) Docker Tech Talk 2121 Container File System View base=/var/lib/docker/aufs/mnt/Container_ID: /dev /etc/hostname /etc/resolv.conf /etc/hosts /proc
  • 22. Sample Agenda 1 Docker Background 2 How to Use Docker 3 Docker Inside 4 Docker Demo Docker Tech Talk 22
  • 23. Thank You! Docker Tech Talk 23 Karnawat.sk@gamil.com https://in.linkedin.com/in/sandeepkarnawat

Editor's Notes

  1. Just say “we put different explanation” because it shows different features.
  2. Only talks about right hand side
  3. Should mention there are lots of images available in docker.io Simple explain on username and image_name
  4. We could mention tag Should clarify image_name And command Explicitly say that -d means “daemon” Don’t read those bullets
  5. How to script the generation of docker images
  6. Hwo the tag system works
  7. http://blog.docker.com/author/jerome/ http://blog.docker.com/2014/06/why-you-dont-need-to-run-sshd-in-docker/ Practise this slide. Yes, it is possible but not the docker way of doing this! Go faster for previous 10 slides Explain nsenter
  8. https://docs.docker.com/introduction/understanding-docker/ Just talk about: Pid: Net: User namespace (simple explain)
  9. https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt It will help you do performance
  10. http://www.thegeekstuff.com/2013/05/linux-aufs/ Animation should show diff from “ro” to “rw”
  11. Check if docker in windows is still using virtual machine.
  12. Say efficient union file system in docker Say the difference and based on the different goals, the following are the differences. Pick up the most interesting point!! Spent less on this paper !!!
  13. Make it more clear
  14. What is the effect of prctl?