SlideShare a Scribd company logo
Build, Ship, and Run Any App, Anywhere
COEP FOSSMeet'18
Rahulkrishnan R A
About Me
» Consultant @ Capgemini
» Debian Contributor
» Gopher
» Organizer of kubernetes Meetup, Chennai
Docker 101
LinkedIn linkedin.com/in/rahulkrishnanra/
Github https://github.com/rahulkrishnanfs
Twitter https://twitter.com/rahulkrishnanra
3What is namespace?
» Feature of the Linux kernel that partitions kernel resources
» Limits what you can see
» Namespaces are the fundamental aspect of containers on Linux
4
Types of namespace
o pid (processes)
o net (network stack)
o mnt (mount points, filesystems)
o uts (hostname)
o ipc (System V IPC)
o user (UIDs)
o cgroups
5
What are they ?
root@ip-172-31-43-99:/# ls -la /proc/4015/ns/
total 0
lrwxrwxrwx 1 cgroup -> cgroup:[4026531835]
lrwxrwxrwx 1 ipc -> ipc:[4026531839]
lrwxrwxrwx 1 mnt -> mnt:[4026531840]
lrwxrwxrwx 1 net -> net:[4026531993]
lrwxrwxrwx 1 pid -> pid:[4026531836]
lrwxrwxrwx 1 user -> user:[4026531837]
lrwxrwxrwx 1 uts -> uts:[4026531838]
6
PID namespace
» Processes within a PID namespace only see processes in the same PID
namespace
» Each PID has its own numbering
» Namespace will be killed if PID one goes away
» Behavior like the “init” process
» PID namespace can be nested, up to 32 nesting levels
7
1
2 3
4, 1
5, 2 6, 3
Child PID namespace
parent PID namespace
Network Namespace
» Logical copy of the network stack
It has its own:
 routes
 firewall rules
 network devices
 IP address
» It helps to separate application/process networking
» You can move network interface across netns
» Newly created network namespace includes only the loopback device
Child net namespace
Child net namespace
Global net namespace
InterfaceInterface
routing
NetworkInterface
Mount namespace
» Processes can have their own rootfs
» Mounts can be totally private or shared
» In the new mount namespace, all previous mounts will be visible
» Mounts/unmounts in the global namespace are visible in that
namespace
UTS namespace
» Appears to have different host and domain names to different
processes.
» UTS namespace provides a way to get information about the system
with commands like uname or hostname
» Simple one to implement
UTS namespace Implementation
func main() {
cmd := exec.Command("/bin/sh")
cmd.SysProcAttr = &syscall.SysProcAttr{
Cloneflags: syscall.CLONE_NEWUTS,
}
syscall.Sethostname([]byte("inner"))
if err := cmd.Run(); err != nil {
panic(err)
}
}
IPC namespace
» Private set of IPC objects inside namespace
eg: shm
User namespace
» Allows to map UID/GID
» Avoid extra configuration in containers
» Security improvement
Container runtime - Docker
How containers looks like?
ContainersVirtual Machines
Interest on Docker – Google trends
https://trends.google.co.in/trends/explore?date=today%205-y&q=docker
Docker Engine
Docker Engine is a client-server application with these major components:
» A REST API which specifies interfaces that programs can use to talk to the daemon and instruct
it what to do
» A command line interface (CLI) client ( the docker command)
» A server which is a type of long-running program called a daemon process (the dockerd
command)
Docker architecture
How docker access the linux kernel?
Docker Images vs Containers
Images
» Lightweight, stand-alone, executable package
» Includes everything needed to run a piece of software, including the
code, a runtime, libraries, environment variables, and config files.
Container
» Runtime instance of an image—what the image becomes in memory
when actually executed.
Docker Image
Sharing the docker image
“
Demo
24
“
Questions
25
“
Thanks !!!
Follow me @rahulkrishnanra
26
😉

More Related Content

PDF
Declare your infrastructure: InfraKit, LinuxKit and Moby
PDF
OSS AWS 핸즈온 강의
PDF
What Have Syscalls Done for you Lately?
PDF
Linux kernel bug hunting
PPTX
Flex pod driven by Openstack
PPT
Installation of application server 10g in red hat 4
PDF
Docker n co
Declare your infrastructure: InfraKit, LinuxKit and Moby
OSS AWS 핸즈온 강의
What Have Syscalls Done for you Lately?
Linux kernel bug hunting
Flex pod driven by Openstack
Installation of application server 10g in red hat 4
Docker n co

What's hot (20)

PDF
Redis clustering
PDF
CoreOSによるDockerコンテナのクラスタリング
PDF
Docker 基本概念與指令操作
PPTX
Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...
PDF
使用 CLI 管理 OpenStack 平台
PDF
Build your own private openstack cloud
ODP
Introduction to Diskless Remote Boot in Linux
PDF
Everyone Loves a Sausage
PPTX
ODP
testing-nfs
TXT
Instructions
PDF
Fixed in drizzle
PPTX
Find the Hacker
PPTX
ODT
Ns 3 installation procedure
PDF
Microsoft Docker Meetup - Tutum Spring 2015
PDF
About linux japanese
PDF
2013 PyCon SG - Building your cloud infrastructure with Python
PDF
An Introduce of OPNFV (Open Platform for NFV)
PDF
Open stack 4day
Redis clustering
CoreOSによるDockerコンテナのクラスタリング
Docker 基本概念與指令操作
Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...
使用 CLI 管理 OpenStack 平台
Build your own private openstack cloud
Introduction to Diskless Remote Boot in Linux
Everyone Loves a Sausage
testing-nfs
Instructions
Fixed in drizzle
Find the Hacker
Ns 3 installation procedure
Microsoft Docker Meetup - Tutum Spring 2015
About linux japanese
2013 PyCon SG - Building your cloud infrastructure with Python
An Introduce of OPNFV (Open Platform for NFV)
Open stack 4day
Ad

Similar to Build, Ship, and Run Any App, Anywhere using Docker (20)

PDF
dotCloud (now Docker) Paas under the_hood
PDF
Namespaces and cgroups - the basis of Linux containers
PPTX
Linux container internals
PDF
The building blocks of docker.
PDF
Linux containers-namespaces(Dec 2014)
PDF
Docker Belgium Meetup
PDF
Linux containers_Docker
PPTX
Cgroups, namespaces and beyond: what are containers made from?
PDF
Understand how docker works
PDF
Understand how docker works
PDF
Rooting Out Root: User namespaces in Docker
PPTX
Introduction to containers
PDF
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
PPTX
Linux network namespaces
PDF
lxc-namespace.pdf
 
PPTX
Docker: Aspects of Container Isolation
PDF
Cgroups, namespaces, and beyond: what are containers made from? (DockerCon Eu...
PDF
Understanding and building Your Own Docker
PDF
Docker containers : introduction
PDF
Docker: Behind the API
dotCloud (now Docker) Paas under the_hood
Namespaces and cgroups - the basis of Linux containers
Linux container internals
The building blocks of docker.
Linux containers-namespaces(Dec 2014)
Docker Belgium Meetup
Linux containers_Docker
Cgroups, namespaces and beyond: what are containers made from?
Understand how docker works
Understand how docker works
Rooting Out Root: User namespaces in Docker
Introduction to containers
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
Linux network namespaces
lxc-namespace.pdf
 
Docker: Aspects of Container Isolation
Cgroups, namespaces, and beyond: what are containers made from? (DockerCon Eu...
Understanding and building Your Own Docker
Docker containers : introduction
Docker: Behind the API
Ad

Recently uploaded (20)

PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
A Presentation on Artificial Intelligence
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Spectroscopy.pptx food analysis technology
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Getting Started with Data Integration: FME Form 101
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPT
Teaching material agriculture food technology
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Empathic Computing: Creating Shared Understanding
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Programs and apps: productivity, graphics, security and other tools
20250228 LYD VKU AI Blended-Learning.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
A Presentation on Artificial Intelligence
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Digital-Transformation-Roadmap-for-Companies.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
Spectroscopy.pptx food analysis technology
NewMind AI Weekly Chronicles - August'25-Week II
Getting Started with Data Integration: FME Form 101
Group 1 Presentation -Planning and Decision Making .pptx
Assigned Numbers - 2025 - Bluetooth® Document
Advanced methodologies resolving dimensionality complications for autism neur...
Teaching material agriculture food technology
MYSQL Presentation for SQL database connectivity
Empathic Computing: Creating Shared Understanding
MIND Revenue Release Quarter 2 2025 Press Release
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx

Build, Ship, and Run Any App, Anywhere using Docker

  • 1. Build, Ship, and Run Any App, Anywhere COEP FOSSMeet'18 Rahulkrishnan R A
  • 2. About Me » Consultant @ Capgemini » Debian Contributor » Gopher » Organizer of kubernetes Meetup, Chennai Docker 101 LinkedIn linkedin.com/in/rahulkrishnanra/ Github https://github.com/rahulkrishnanfs Twitter https://twitter.com/rahulkrishnanra
  • 3. 3What is namespace? » Feature of the Linux kernel that partitions kernel resources » Limits what you can see » Namespaces are the fundamental aspect of containers on Linux
  • 4. 4 Types of namespace o pid (processes) o net (network stack) o mnt (mount points, filesystems) o uts (hostname) o ipc (System V IPC) o user (UIDs) o cgroups
  • 5. 5 What are they ? root@ip-172-31-43-99:/# ls -la /proc/4015/ns/ total 0 lrwxrwxrwx 1 cgroup -> cgroup:[4026531835] lrwxrwxrwx 1 ipc -> ipc:[4026531839] lrwxrwxrwx 1 mnt -> mnt:[4026531840] lrwxrwxrwx 1 net -> net:[4026531993] lrwxrwxrwx 1 pid -> pid:[4026531836] lrwxrwxrwx 1 user -> user:[4026531837] lrwxrwxrwx 1 uts -> uts:[4026531838]
  • 6. 6 PID namespace » Processes within a PID namespace only see processes in the same PID namespace » Each PID has its own numbering » Namespace will be killed if PID one goes away » Behavior like the “init” process » PID namespace can be nested, up to 32 nesting levels
  • 7. 7 1 2 3 4, 1 5, 2 6, 3 Child PID namespace parent PID namespace
  • 8. Network Namespace » Logical copy of the network stack It has its own:  routes  firewall rules  network devices  IP address » It helps to separate application/process networking » You can move network interface across netns » Newly created network namespace includes only the loopback device
  • 9. Child net namespace Child net namespace Global net namespace InterfaceInterface routing NetworkInterface
  • 10. Mount namespace » Processes can have their own rootfs » Mounts can be totally private or shared » In the new mount namespace, all previous mounts will be visible » Mounts/unmounts in the global namespace are visible in that namespace
  • 11. UTS namespace » Appears to have different host and domain names to different processes. » UTS namespace provides a way to get information about the system with commands like uname or hostname » Simple one to implement
  • 12. UTS namespace Implementation func main() { cmd := exec.Command("/bin/sh") cmd.SysProcAttr = &syscall.SysProcAttr{ Cloneflags: syscall.CLONE_NEWUTS, } syscall.Sethostname([]byte("inner")) if err := cmd.Run(); err != nil { panic(err) } }
  • 13. IPC namespace » Private set of IPC objects inside namespace eg: shm
  • 14. User namespace » Allows to map UID/GID » Avoid extra configuration in containers » Security improvement
  • 16. How containers looks like? ContainersVirtual Machines
  • 17. Interest on Docker – Google trends https://trends.google.co.in/trends/explore?date=today%205-y&q=docker
  • 18. Docker Engine Docker Engine is a client-server application with these major components: » A REST API which specifies interfaces that programs can use to talk to the daemon and instruct it what to do » A command line interface (CLI) client ( the docker command) » A server which is a type of long-running program called a daemon process (the dockerd command)
  • 20. How docker access the linux kernel?
  • 21. Docker Images vs Containers Images » Lightweight, stand-alone, executable package » Includes everything needed to run a piece of software, including the code, a runtime, libraries, environment variables, and config files. Container » Runtime instance of an image—what the image becomes in memory when actually executed.
  • 26. “ Thanks !!! Follow me @rahulkrishnanra 26 😉