Home >Technology >Docker - Ankara JUG, Nisan 2015

Docker - Ankara JUG, Nisan 2015

Date post:15-Jul-2015
View:424 times
Download:3 times
Share this document with a friend

PowerPoint Presentation

Mustafa AKINAnkara Java Users Group16 April 2015

What is Docker? And what it means to you?What is Docker?An open platformPortable, lightweight runtime and packaging toolAutomating deployment of applications inside software containersOperating-system-level virtualizationIsolated containersAs noted in their website, www.docker.com2Virtual Machines, HypervisorsKVM, kernel based virtual machineVirtualize an entire system

Virtual CPUVirtual Hard DiskVirtual Network

Hypervisors: KVM, Xen3ContainersContainers share same Linux Kernel

Isolation possible by namespaces, cgroups provided by Linux KernelMicrosoft has started providing Native Windows Containers

Containers vs Virtual Machines

Performance of Containers

An Updated Performance Comparison of Virtual Machines and Linux Containers, IBM ResearchHow does Docker Work?Operating system provides you a set of system callsYou do not actually read file, read from socket, write output to screenOperating system handles most crucial functionality for youDocker utilizes namespaces for abstracting access to system resourcesDocker also utilizes cgroups, that provides namespace isolationCgroups also provide resource accounting and limitationNamespacesMount: Isolate the set of file system mount points for processesUTS: Isolates domain name and host nameIPC: Inter process communication, such as shared memory, named semaphores, message queuesPID: Process ID number space. So init process of each namespace can be differentNetwork: Different network devices, routing tablesUser: Different user ids for inside and outside of namespaceRegular htop

htop inside a container

Docker imagesDocker mounts images as the root file system of a containerImages in Docker are layered: like git, you have to commit changes to create a new image, or update the current versionImage layers can be shared among containersSharing layers increases performance since the common files will be in cache, and also reduces the disk usage

Example usage of images

Layers of imagesDocker hub


Control Groups (cgroups)blkio: set limits and monitor usage of block devices such as diskscpu: scheduling, weights of taskscpuacct: usage reports of cpus cpuset: assign cpus and memory nodes to tasksdevices: allow access to devices (webcam, gpu etc.)memory: limit on memory, and usage reportsnet_prio: priority on network interfaces

Example of cpuacct

Aggregating Docker metrics

My own project to gather cgroup metrics for containers: https://github.com/mustafaakin/docker-resource-reporter


Containerizing GUI Apps$ docker run -it \ -v /tmp/.X11-unix:/tmp/.X11-unix \ # mount the X11 socket -e DISPLAY=unix$DISPLAY \ # pass the display -v /dev/snd:/dev/snd --privileged \ # sound --name tor-browser jess/tor-browser

Containerizing Ubuntu Desktopdocker run -i -t -p 6080:6080 dorowu/ubuntu-desktop-lxde-vnc

Running a database

23Mounting Data

Poor mans Continuous integration

Rich mans continuous integrationCircleCIBambooJenkinsTravisCIShippable

PrimeFaces showcase

Running Benchmarks

Selenium Grid

Selenium Grid

PAGS: Programming Assignment Grading System

http://pags.cs.bilkent.edu.tr or http://code.gy

PAGS, Programming Assignment Grading System

PAGS, Programming Assignment Grading System

My Research

Twelve Factor AppI. CodebaseOne codebase tracked in revision control, many deploysII. DependenciesExplicitly declare and isolate dependenciesIII. ConfigStore config in the environmentIV. Backing ServicesTreat backing services as attached resources

V. Build, release, runStrictly separate build and run stagesVI. ProcessesExecute the app as one or more stateless processesVII. Port bindingExport services via port bindingVIII. ConcurrencyScale out via the process model

IX. DisposabilityMaximize robustness with fast startup and graceful shutdownX. Dev/prod parityKeep development, staging, and production as similar as possibleXI. LogsTreat logs as event streamsXII. Admin processesRun admin/management tasks as one-off processesHeroku

Deis Your own Heroku

Deis Your own Heroku

Deis Your own Heroku

IBM Bluemix

RancherOS: Dockerize everything

Rancher UI

Docker Web UIs

Kitematic: GUI for Docker

Kubernetes by Google

Docker Compose (Fig)

Docker Swarm

Use filtering:Constraints:Labeling, SSD Server, Big Server..Operating SystemKernel VersionAffinitySchedule 2 containers togetherPortAvailabilityDependencyContainers might be using volumes, or share network stack

Docker Machine

Docker-ready cloudsAmazon EC2 Container ServiceGoogle Container EngineDigital Ocean

Docker investmentsSeries B: 21 Jan 2014 $15MSeries C: 16 Sep 2014 $40MSeries D: 14 Apr 2015: $95M

Docker initial release: 13 March 2013

Windows side.. Docker Client!

Windows side, Nano Server!

Remote APIHTTP over Unix Socket, TCP Socket, Optionally TLS JSON APICreate containerStart containerWait containerList containersSearch imagePull/Push imagesBuild image from DockerfileHijacked HTTP API or alternatively WebSocket API for attaching to container, to see its output in real-timeMustafa AKINTwitter: @mustafaakinMail: [email protected]: www.mustafaak.in

Feel free to contact for Docker related questions, or anything else!THANKSFOR LISTENING!54

Click here to load reader

Reader Image
Embed Size (px)