SlideShare a Scribd company logo
Docker
Kamil y3ti Grabowski
UW@IT- 25.02.2015
DOCKER Czym jest?
• nowa „seksi” technologia?
• tak, ale działająca również na starym sprzęcie! (kernel 3.8)
• chroot, bsd jail oraz solaris zones również działały!
• oczywiście, ale:
• docker images
• warstwowy system plików
• docker hub
• docker registry
• HTTP REST like API
• biblioteki dla większości popularnych języków
programowania
DOCKER vs VIRTUAL MACHINE
Hardware
Host OS
Hypervisor
Guest OS
Bin/Libs
APP
Guest OS
Bin/Libs
APP
Guest OS
Bin/Libs
DB
Hardware
Host OS
Bin/Libs
APP APP
Bin/Libs
DB
Docker
Virtual Machine
DOCKER Jak to działa?
• lxc - LinuX Containers
• linux namespaces (pid, net, mnt, ipc, uts)
• cgroups (przypisywanie procesów do grup, kontrola
zasobów, limity)
• union filesystem
• format kontenerów (libcontainer oraz lxc)
DOCKER Gdzie on jest?
DOCKER Instalacja
# apt-get install docker.io
Instalacja z oficjalnego repozytorium ubuntu
# apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-
keys 36A1D7869245C8950F966E92D8576A8BA88D21E9



# echo "deb https://get.docker.com/ubuntu docker main" 

> /etc/apt/sources.list.d/docker.list



# apt-get update

# apt-get install lxc-docker
Instalacja z 3rd-party repozytorium dockera
więcej informacji w dokumentacji:
https://docs.docker.com/installation/#installation
DOCKER Pobieranie obrazu aplikacji
host # docker pull ubuntu:14.04



511136ea3c5a: Pull complete 

511136ea3c5a: Download complete 

fa4fd76b09ce: Download complete 

1c8294cc5160: Download complete 

117ee323aaa9: Download complete 

2d24f826cb16: Download complete 

Status: Downloaded newer image for ubuntu:14.04



host # docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE

ubuntu trusty-20150218.1 2d24f826cb16 2 days ago 188.3 MB

ubuntu latest 2d24f826cb16 2 days ago 188.3 MB

ubuntu 14.04 2d24f826cb16 2 days ago 188.3 MB

ubuntu 14.04.2 2d24f826cb16 2 days ago 188.3 MB

ubuntu trusty 2d24f826cb16 2 days ago 188.3 MB
DOCKER Uruchomienie aplikacji bash
host # docker run -ti ubuntu:14.04 /bin/bash



root@749b70696917:/# ps au



USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND

root 1 0.3 0.3 18168 1912 ? Ss 21:45 0:00 /bin/bash

root 19 0.0 0.2 15568 1136 ? R+ 21:45 0:00 ps au
root@749b70696917:/# exit

exit
DOCKER Detach containers
host # docker run -d postgres:latest



Unable to find image 'postgres:latest' locally

429ae004fde9: Pull complete 

662027bf7ac7: Downloading [===============> ] 98.63 MB/104.4 MB 2s

52dec81c6cd5: Download complete 

9fccd63a9a1f: Download complete 

Status: Downloaded newer image for postgres:latest
a2fef904f62d815c7c7f993bff66e82c91608ad12482f2916423c025ae078bb0
DOCKER Lista kontenerów
host # docker ps



CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 

a2fef904f62d postgres … 1 min… Up 9 min… 5432/tcp sleepy_darwin



host # docker ps -a



CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 

a2fef904f62d postgres … 1 min… Up 9 min… 5432/tcp sleepy_darwin

28ec28d16d57 ubuntu:14 … 30 min… Exited (0) silly_morse
host # docker ps -a -q



a2fef904f62d

28ec28d16d57
DOCKER Konfiguracja nazwy i portu tcp
host # docker run -d --name postgres -p 5432:5432 postgres:latest



c3b16d4d682aac528ead5cded3e7c29b32de66101bc9639b05fc45ab02cf338e



host # docker ps



CONTAINER ID IMAGE … PORTS NAMES 

c3b16d4d682a postgres:latest … 0.0.0.0:5432->5432/tcp postgres

a2fef904f62d postgres:latest … 5432/tcp sleepy_darwin



host # docker run -d --name postgres02 -P postgres:latest



391390c80134079f40747f34c240218b9f4c06c5b6537048ab795ebc89cd01d9
host # docker ps



CONTAINER ID IMAGE … PORTS NAMES 

391390c80134 postgres:latest … 0.0.0.0:49153->5432/tcp postgres02

c3b16d4d682a postgres:latest … 0.0.0.0:5432->5432/tcp postgres

a2fef904f62d postgres:latest … 5432/tcp sleepy_darwin
DOCKER exec
host # docker exec -ti postgres /bin/bash



root@38d0dc500374:/# ps auxf
PID TTY STAT TIME COMMAND

14 ? S 0:00 /bin/bash

26 ? R+ 0:00 _ ps axf

1 ? Ss 0:00 postgres

9 ? Ss 0:00 postgres: checkpointer process 

10 ? Ss 0:00 postgres: writer process

11 ? Ss 0:00 postgres: wal writer process

12 ? Ss 0:00 postgres: autovacuum launcher process

13 ? Ss 0:00 postgres: stats collector process
DOCKER diff
host # docker diff postgres



C /var

C /var/lib

C /var/lib/postgresql

A /var/lib/postgresql/data

C /run

C /run/postgresql

A /run/postgresql/.s.PGSQL.5432

A /run/postgresql/.s.PGSQL.5432.lock

C /root

A /root/.bash_history

C /tmp
DOCKER volumes oraz data containers
host # docker rm -f postgres



host # docker create --name postgres_data 

-v /var/lib/postgreql/data postgres



4399af09862693f2c0b36e3473c737ac7d4d9e0f7b6301f8715835b1b08ccd6a



host # docker run -d —name postgres 

--volumes-from postgres_data postgres



2c0e1e0ab084c886d66358a02c561e1c1d7a7b47ef5dc7883e493bdba97750fd
DOCKER bind volumes
host # docker rm -f postgres

host # docker run -d —name postgres 

-v /data/postgresql:/var/lib/postgreql/data postgres



79da06295d684b5b5120e6eddd24d0af38309590ef264b39c741781bdf7a58c4



host # ls /data/postgresql/



base pg_clog pg_hba.conf pg_logical pg_notify
pg_serial pg_stat pg_subtrans pg_twophase pg_xlog
postgresql.conf postmaster.pid global pg_dynshmem
pg_ident.conf pg_multixact pg_replslot pg_snapshots 

pg_stat_tmp pg_tblspc PG_VERSION postgresql.auto.conf
postmaster.opts
DOCKER operacje na obrazach
• build
• history
• save / load
• images (list images)
• pull / push
• rmi (remove)
• search
• tag
DOCKER operacje na kontenerach
• attach / wait
• diff / commit
• cp
• create / run / exec
• export
• inspect
• kill / start / stop / restart
• ps / top
• rename / rm (remove)
DOCKER budowanie własnych obrazów
host # ls

Dockerfile



host # cat Dockerfile



FROM ubuntu:14.04



RUN apt-get update

RUN apt-get install -y nginx



EXPOSE 80

EXPOSE 443



CMD ["nginx", "-g", "daemon off;"]



host # docker build -t my-nginx .



host # docker run -d -p 80:80 my-nginx

DOCKER co jeszcze warto powiedzieć?
• hub.docker.com
• Własne registry
• Docker events
• HTTP API (json) + biblioteki dla wielu języków
programowania
• CoreOS (docker + etcd + confd + systemd + fleet)
• Fig
• www.dotcloud.com / www.cloud66.com
DOCKER Bibliografia
• https://www.docker.com
• instalacja i konfiguracja
• dokumentacja (commandline, API, registry)
• https://hub.docker.com
• http://www.fig.sh
• https://coreos.com
Pytania?
Dziękuję za uwagę
Kamil y3ti Grabowski

More Related Content

What's hot

Journey to Microservice architecture via Amazon Lambda
Journey to Microservice architecture via Amazon LambdaJourney to Microservice architecture via Amazon Lambda
Journey to Microservice architecture via Amazon Lambda
Axilis
 
Small, Simple, and Secure: Alpine Linux under the Microscope
Small, Simple, and Secure: Alpine Linux under the MicroscopeSmall, Simple, and Secure: Alpine Linux under the Microscope
Small, Simple, and Secure: Alpine Linux under the Microscope
Docker, Inc.
 
Learn basic ansible using docker
Learn basic ansible using dockerLearn basic ansible using docker
Learn basic ansible using docker
Larry Cai
 
Eduardo Silva - monkey http-server everywhere
Eduardo Silva - monkey http-server everywhereEduardo Silva - monkey http-server everywhere
Eduardo Silva - monkey http-server everywhereStarTech Conference
 
Object Storage with Gluster
Object Storage with GlusterObject Storage with Gluster
Object Storage with Gluster
Gluster.org
 
Ansible intro
Ansible introAnsible intro
Ansible intro
Hsi-Kai Wang
 
IT Automation with Ansible
IT Automation with AnsibleIT Automation with Ansible
IT Automation with Ansible
Rayed Alrashed
 
Масштабируемая конфигурация Nginx, Игорь Сысоев (Nginx)
Масштабируемая конфигурация Nginx, Игорь Сысоев (Nginx)Масштабируемая конфигурация Nginx, Игорь Сысоев (Nginx)
Масштабируемая конфигурация Nginx, Игорь Сысоев (Nginx)
Ontico
 
Multiple django applications on a single server with nginx
Multiple django applications on a single server with nginxMultiple django applications on a single server with nginx
Multiple django applications on a single server with nginx
roskakori
 
Enjoying k8s cluster with Minikube and Helm
Enjoying k8s cluster with Minikube and HelmEnjoying k8s cluster with Minikube and Helm
Enjoying k8s cluster with Minikube and Helm
ロフト くん
 
A quick intro to Ansible
A quick intro to AnsibleA quick intro to Ansible
A quick intro to Ansible
Dan Vaida
 
Docker up and running
Docker up and runningDocker up and running
Docker up and running
Victor S. Recio
 
OpenNebula, the foreman and CentOS play nice, too
OpenNebula, the foreman and CentOS play nice, tooOpenNebula, the foreman and CentOS play nice, too
OpenNebula, the foreman and CentOS play nice, too
inovex GmbH
 
Ansible with AWS
Ansible with AWSAnsible with AWS
Ansible with AWS
Allan Denot
 
Using Capifony for Symfony apps deployment (updated)
Using Capifony for Symfony apps deployment (updated)Using Capifony for Symfony apps deployment (updated)
Using Capifony for Symfony apps deployment (updated)
Žilvinas Kuusas
 
Automating Mendix application deployments with Nix
Automating Mendix application deployments with NixAutomating Mendix application deployments with Nix
Automating Mendix application deployments with Nix
Sander van der Burg
 
Testing applications with traffic control in containers / Alban Crequy (Kinvolk)
Testing applications with traffic control in containers / Alban Crequy (Kinvolk)Testing applications with traffic control in containers / Alban Crequy (Kinvolk)
Testing applications with traffic control in containers / Alban Crequy (Kinvolk)
Ontico
 

What's hot (20)

Journey to Microservice architecture via Amazon Lambda
Journey to Microservice architecture via Amazon LambdaJourney to Microservice architecture via Amazon Lambda
Journey to Microservice architecture via Amazon Lambda
 
Small, Simple, and Secure: Alpine Linux under the Microscope
Small, Simple, and Secure: Alpine Linux under the MicroscopeSmall, Simple, and Secure: Alpine Linux under the Microscope
Small, Simple, and Secure: Alpine Linux under the Microscope
 
Learn basic ansible using docker
Learn basic ansible using dockerLearn basic ansible using docker
Learn basic ansible using docker
 
Eduardo Silva - monkey http-server everywhere
Eduardo Silva - monkey http-server everywhereEduardo Silva - monkey http-server everywhere
Eduardo Silva - monkey http-server everywhere
 
T.Pollak y C.Yaconi - Prey
T.Pollak y C.Yaconi - PreyT.Pollak y C.Yaconi - Prey
T.Pollak y C.Yaconi - Prey
 
JavaScript Event Loop
JavaScript Event LoopJavaScript Event Loop
JavaScript Event Loop
 
Object Storage with Gluster
Object Storage with GlusterObject Storage with Gluster
Object Storage with Gluster
 
Ansible intro
Ansible introAnsible intro
Ansible intro
 
IT Automation with Ansible
IT Automation with AnsibleIT Automation with Ansible
IT Automation with Ansible
 
Масштабируемая конфигурация Nginx, Игорь Сысоев (Nginx)
Масштабируемая конфигурация Nginx, Игорь Сысоев (Nginx)Масштабируемая конфигурация Nginx, Игорь Сысоев (Nginx)
Масштабируемая конфигурация Nginx, Игорь Сысоев (Nginx)
 
Multiple django applications on a single server with nginx
Multiple django applications on a single server with nginxMultiple django applications on a single server with nginx
Multiple django applications on a single server with nginx
 
Enjoying k8s cluster with Minikube and Helm
Enjoying k8s cluster with Minikube and HelmEnjoying k8s cluster with Minikube and Helm
Enjoying k8s cluster with Minikube and Helm
 
A quick intro to Ansible
A quick intro to AnsibleA quick intro to Ansible
A quick intro to Ansible
 
Docker up and running
Docker up and runningDocker up and running
Docker up and running
 
OpenNebula, the foreman and CentOS play nice, too
OpenNebula, the foreman and CentOS play nice, tooOpenNebula, the foreman and CentOS play nice, too
OpenNebula, the foreman and CentOS play nice, too
 
Ansible with AWS
Ansible with AWSAnsible with AWS
Ansible with AWS
 
Using Capifony for Symfony apps deployment (updated)
Using Capifony for Symfony apps deployment (updated)Using Capifony for Symfony apps deployment (updated)
Using Capifony for Symfony apps deployment (updated)
 
Automating Mendix application deployments with Nix
Automating Mendix application deployments with NixAutomating Mendix application deployments with Nix
Automating Mendix application deployments with Nix
 
Testing applications with traffic control in containers / Alban Crequy (Kinvolk)
Testing applications with traffic control in containers / Alban Crequy (Kinvolk)Testing applications with traffic control in containers / Alban Crequy (Kinvolk)
Testing applications with traffic control in containers / Alban Crequy (Kinvolk)
 
Node.js and Ruby
Node.js and RubyNode.js and Ruby
Node.js and Ruby
 

Viewers also liked

Infrastructure As Code
Infrastructure As CodeInfrastructure As Code
Infrastructure As Code
Kamil Grabowski
 
LXC - kontener pingwinów
LXC - kontener pingwinówLXC - kontener pingwinów
LXC - kontener pingwinów
gnosek
 
Elasticsearch i Docker - skalowalność, wysoka dostępność i zarządzanie zasobami
Elasticsearch i Docker - skalowalność, wysoka dostępność i zarządzanie zasobamiElasticsearch i Docker - skalowalność, wysoka dostępność i zarządzanie zasobami
Elasticsearch i Docker - skalowalność, wysoka dostępność i zarządzanie zasobami
Enterprise Search Warsaw Meetup
 
Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...
Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...
Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...
ForgeRock
 
OIS Architecture Review
OIS Architecture ReviewOIS Architecture Review
OIS Architecture Review
ForgeRock
 
Ansible - Automatyzacja zadań IT
Ansible - Automatyzacja zadań ITAnsible - Automatyzacja zadań IT
Ansible - Automatyzacja zadań IT
Kamil Grabowski
 
Docker
DockerDocker
Elk stack
Elk stackElk stack
Elk stack
Jilles van Gurp
 
Solr Anti - patterns
Solr Anti - patternsSolr Anti - patterns
Solr Anti - patterns
Rafał Kuć
 

Viewers also liked (9)

Infrastructure As Code
Infrastructure As CodeInfrastructure As Code
Infrastructure As Code
 
LXC - kontener pingwinów
LXC - kontener pingwinówLXC - kontener pingwinów
LXC - kontener pingwinów
 
Elasticsearch i Docker - skalowalność, wysoka dostępność i zarządzanie zasobami
Elasticsearch i Docker - skalowalność, wysoka dostępność i zarządzanie zasobamiElasticsearch i Docker - skalowalność, wysoka dostępność i zarządzanie zasobami
Elasticsearch i Docker - skalowalność, wysoka dostępność i zarządzanie zasobami
 
Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...
Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...
Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...
 
OIS Architecture Review
OIS Architecture ReviewOIS Architecture Review
OIS Architecture Review
 
Ansible - Automatyzacja zadań IT
Ansible - Automatyzacja zadań ITAnsible - Automatyzacja zadań IT
Ansible - Automatyzacja zadań IT
 
Docker
DockerDocker
Docker
 
Elk stack
Elk stackElk stack
Elk stack
 
Solr Anti - patterns
Solr Anti - patternsSolr Anti - patterns
Solr Anti - patterns
 

Similar to Docker

Real World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionReal World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and Production
Ben Hall
 
Docker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in PragueDocker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in Prague
tomasbart
 
Docker: The basics - Including a demo with an awesome full-stack JS app
Docker: The basics - Including a demo with an awesome full-stack JS appDocker: The basics - Including a demo with an awesome full-stack JS app
Docker: The basics - Including a demo with an awesome full-stack JS app
Marcelo Rodrigues
 
Creating docker custom image
Creating docker custom imageCreating docker custom image
Creating docker custom image
t lc
 
Creating docker custom image
Creating docker custom imageCreating docker custom image
Creating docker custom image
t lc
 
Docker orchestration v4
Docker orchestration v4Docker orchestration v4
Docker orchestration v4
Hojin Kim
 
Docker practice
Docker practiceDocker practice
Docker practice
wonyong hwang
 
Develop QNAP NAS App by Docker
Develop QNAP NAS App by DockerDevelop QNAP NAS App by Docker
Develop QNAP NAS App by Docker
Terry Chen
 
Docker for Web Developers: A Sneak Peek
Docker for Web Developers: A Sneak PeekDocker for Web Developers: A Sneak Peek
Docker for Web Developers: A Sneak Peek
msyukor
 
Introduction to Docker - Learning containerization XP conference 2016
Introduction to Docker - Learning containerization  XP conference 2016Introduction to Docker - Learning containerization  XP conference 2016
Introduction to Docker - Learning containerization XP conference 2016
XP Conference India
 
Docker 활용법: dumpdocker
Docker 활용법: dumpdockerDocker 활용법: dumpdocker
Docker 활용법: dumpdocker
Jaehwa Park
 
Docker as an every day work tool
Docker as an every day work toolDocker as an every day work tool
Docker as an every day work tool
Przemyslaw Koltermann
 
Docker 1.11 Presentation
Docker 1.11 PresentationDocker 1.11 Presentation
Docker 1.11 Presentation
Sreenivas Makam
 
Docker
DockerDocker
Docker
Cary Gordon
 
Super powered Drupal development with docker
Super powered Drupal development with dockerSuper powered Drupal development with docker
Super powered Drupal development with docker
Maciej Lukianski
 
Streamline your development environment with docker
Streamline your development environment with dockerStreamline your development environment with docker
Streamline your development environment with docker
Giacomo Bagnoli
 
From zero to Docker
From zero to DockerFrom zero to Docker
From zero to Docker
Giovanni Toraldo
 
JDD2014: Docker.io - versioned linux containers for JVM devops - Dominik Dorn
JDD2014: Docker.io - versioned linux containers for JVM devops - Dominik DornJDD2014: Docker.io - versioned linux containers for JVM devops - Dominik Dorn
JDD2014: Docker.io - versioned linux containers for JVM devops - Dominik Dorn
PROIDEA
 
Check the version with fixes. Link in description
Check the version with fixes. Link in descriptionCheck the version with fixes. Link in description
Check the version with fixes. Link in description
Przemyslaw Koltermann
 

Similar to Docker (20)

Real World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionReal World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and Production
 
Docker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in PragueDocker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in Prague
 
Docker: The basics - Including a demo with an awesome full-stack JS app
Docker: The basics - Including a demo with an awesome full-stack JS appDocker: The basics - Including a demo with an awesome full-stack JS app
Docker: The basics - Including a demo with an awesome full-stack JS app
 
Creating docker custom image
Creating docker custom imageCreating docker custom image
Creating docker custom image
 
Creating docker custom image
Creating docker custom imageCreating docker custom image
Creating docker custom image
 
Docker orchestration
Docker orchestrationDocker orchestration
Docker orchestration
 
Docker orchestration v4
Docker orchestration v4Docker orchestration v4
Docker orchestration v4
 
Docker practice
Docker practiceDocker practice
Docker practice
 
Develop QNAP NAS App by Docker
Develop QNAP NAS App by DockerDevelop QNAP NAS App by Docker
Develop QNAP NAS App by Docker
 
Docker for Web Developers: A Sneak Peek
Docker for Web Developers: A Sneak PeekDocker for Web Developers: A Sneak Peek
Docker for Web Developers: A Sneak Peek
 
Introduction to Docker - Learning containerization XP conference 2016
Introduction to Docker - Learning containerization  XP conference 2016Introduction to Docker - Learning containerization  XP conference 2016
Introduction to Docker - Learning containerization XP conference 2016
 
Docker 활용법: dumpdocker
Docker 활용법: dumpdockerDocker 활용법: dumpdocker
Docker 활용법: dumpdocker
 
Docker as an every day work tool
Docker as an every day work toolDocker as an every day work tool
Docker as an every day work tool
 
Docker 1.11 Presentation
Docker 1.11 PresentationDocker 1.11 Presentation
Docker 1.11 Presentation
 
Docker
DockerDocker
Docker
 
Super powered Drupal development with docker
Super powered Drupal development with dockerSuper powered Drupal development with docker
Super powered Drupal development with docker
 
Streamline your development environment with docker
Streamline your development environment with dockerStreamline your development environment with docker
Streamline your development environment with docker
 
From zero to Docker
From zero to DockerFrom zero to Docker
From zero to Docker
 
JDD2014: Docker.io - versioned linux containers for JVM devops - Dominik Dorn
JDD2014: Docker.io - versioned linux containers for JVM devops - Dominik DornJDD2014: Docker.io - versioned linux containers for JVM devops - Dominik Dorn
JDD2014: Docker.io - versioned linux containers for JVM devops - Dominik Dorn
 
Check the version with fixes. Link in description
Check the version with fixes. Link in descriptionCheck the version with fixes. Link in description
Check the version with fixes. Link in description
 

More from Kamil Grabowski

Jak wygrać Igrzyska Chmury
Jak wygrać Igrzyska ChmuryJak wygrać Igrzyska Chmury
Jak wygrać Igrzyska Chmury
Kamil Grabowski
 
Sekrety magicznego ogrodu Docker
Sekrety magicznego ogrodu DockerSekrety magicznego ogrodu Docker
Sekrety magicznego ogrodu Docker
Kamil Grabowski
 
Porażka nie wchodzi w grę, czyli o niezawodności
Porażka nie wchodzi w grę, czyli o niezawodnościPorażka nie wchodzi w grę, czyli o niezawodności
Porażka nie wchodzi w grę, czyli o niezawodności
Kamil Grabowski
 
Ansible w praktyce
Ansible w praktyceAnsible w praktyce
Ansible w praktyce
Kamil Grabowski
 
RRDTool + RUBY DSL = RRD-FFI
RRDTool + RUBY DSL = RRD-FFIRRDTool + RUBY DSL = RRD-FFI
RRDTool + RUBY DSL = RRD-FFI
Kamil Grabowski
 
Jak wyglada monitoring w PLIX
Jak wyglada monitoring w PLIXJak wyglada monitoring w PLIX
Jak wyglada monitoring w PLIX
Kamil Grabowski
 
Monitoring sieci
Monitoring sieciMonitoring sieci
Monitoring sieci
Kamil Grabowski
 
Sprzetowe i programowe aspekty punktu wymiany ruchu
Sprzetowe i programowe aspekty punktu wymiany ruchuSprzetowe i programowe aspekty punktu wymiany ruchu
Sprzetowe i programowe aspekty punktu wymiany ruchu
Kamil Grabowski
 
How to create effective NOC in Poland
How to create effective NOC in PolandHow to create effective NOC in Poland
How to create effective NOC in Poland
Kamil Grabowski
 

More from Kamil Grabowski (9)

Jak wygrać Igrzyska Chmury
Jak wygrać Igrzyska ChmuryJak wygrać Igrzyska Chmury
Jak wygrać Igrzyska Chmury
 
Sekrety magicznego ogrodu Docker
Sekrety magicznego ogrodu DockerSekrety magicznego ogrodu Docker
Sekrety magicznego ogrodu Docker
 
Porażka nie wchodzi w grę, czyli o niezawodności
Porażka nie wchodzi w grę, czyli o niezawodnościPorażka nie wchodzi w grę, czyli o niezawodności
Porażka nie wchodzi w grę, czyli o niezawodności
 
Ansible w praktyce
Ansible w praktyceAnsible w praktyce
Ansible w praktyce
 
RRDTool + RUBY DSL = RRD-FFI
RRDTool + RUBY DSL = RRD-FFIRRDTool + RUBY DSL = RRD-FFI
RRDTool + RUBY DSL = RRD-FFI
 
Jak wyglada monitoring w PLIX
Jak wyglada monitoring w PLIXJak wyglada monitoring w PLIX
Jak wyglada monitoring w PLIX
 
Monitoring sieci
Monitoring sieciMonitoring sieci
Monitoring sieci
 
Sprzetowe i programowe aspekty punktu wymiany ruchu
Sprzetowe i programowe aspekty punktu wymiany ruchuSprzetowe i programowe aspekty punktu wymiany ruchu
Sprzetowe i programowe aspekty punktu wymiany ruchu
 
How to create effective NOC in Poland
How to create effective NOC in PolandHow to create effective NOC in Poland
How to create effective NOC in Poland
 

Recently uploaded

Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 

Recently uploaded (20)

Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 

Docker

  • 2.
  • 3.
  • 4. DOCKER Czym jest? • nowa „seksi” technologia? • tak, ale działająca również na starym sprzęcie! (kernel 3.8) • chroot, bsd jail oraz solaris zones również działały! • oczywiście, ale: • docker images • warstwowy system plików • docker hub • docker registry • HTTP REST like API • biblioteki dla większości popularnych języków programowania
  • 5. DOCKER vs VIRTUAL MACHINE Hardware Host OS Hypervisor Guest OS Bin/Libs APP Guest OS Bin/Libs APP Guest OS Bin/Libs DB Hardware Host OS Bin/Libs APP APP Bin/Libs DB Docker Virtual Machine
  • 6. DOCKER Jak to działa? • lxc - LinuX Containers • linux namespaces (pid, net, mnt, ipc, uts) • cgroups (przypisywanie procesów do grup, kontrola zasobów, limity) • union filesystem • format kontenerów (libcontainer oraz lxc)
  • 8. DOCKER Instalacja # apt-get install docker.io Instalacja z oficjalnego repozytorium ubuntu # apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv- keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
 
 # echo "deb https://get.docker.com/ubuntu docker main" 
 > /etc/apt/sources.list.d/docker.list
 
 # apt-get update
 # apt-get install lxc-docker Instalacja z 3rd-party repozytorium dockera więcej informacji w dokumentacji: https://docs.docker.com/installation/#installation
  • 9. DOCKER Pobieranie obrazu aplikacji host # docker pull ubuntu:14.04
 
 511136ea3c5a: Pull complete 
 511136ea3c5a: Download complete 
 fa4fd76b09ce: Download complete 
 1c8294cc5160: Download complete 
 117ee323aaa9: Download complete 
 2d24f826cb16: Download complete 
 Status: Downloaded newer image for ubuntu:14.04
 
 host # docker images REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
 ubuntu trusty-20150218.1 2d24f826cb16 2 days ago 188.3 MB
 ubuntu latest 2d24f826cb16 2 days ago 188.3 MB
 ubuntu 14.04 2d24f826cb16 2 days ago 188.3 MB
 ubuntu 14.04.2 2d24f826cb16 2 days ago 188.3 MB
 ubuntu trusty 2d24f826cb16 2 days ago 188.3 MB
  • 10. DOCKER Uruchomienie aplikacji bash host # docker run -ti ubuntu:14.04 /bin/bash
 
 root@749b70696917:/# ps au
 
 USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
 root 1 0.3 0.3 18168 1912 ? Ss 21:45 0:00 /bin/bash
 root 19 0.0 0.2 15568 1136 ? R+ 21:45 0:00 ps au root@749b70696917:/# exit
 exit
  • 11. DOCKER Detach containers host # docker run -d postgres:latest
 
 Unable to find image 'postgres:latest' locally
 429ae004fde9: Pull complete 
 662027bf7ac7: Downloading [===============> ] 98.63 MB/104.4 MB 2s
 52dec81c6cd5: Download complete 
 9fccd63a9a1f: Download complete 
 Status: Downloaded newer image for postgres:latest a2fef904f62d815c7c7f993bff66e82c91608ad12482f2916423c025ae078bb0
  • 12. DOCKER Lista kontenerów host # docker ps
 
 CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 
 a2fef904f62d postgres … 1 min… Up 9 min… 5432/tcp sleepy_darwin
 
 host # docker ps -a
 
 CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 
 a2fef904f62d postgres … 1 min… Up 9 min… 5432/tcp sleepy_darwin
 28ec28d16d57 ubuntu:14 … 30 min… Exited (0) silly_morse host # docker ps -a -q
 
 a2fef904f62d
 28ec28d16d57
  • 13. DOCKER Konfiguracja nazwy i portu tcp host # docker run -d --name postgres -p 5432:5432 postgres:latest
 
 c3b16d4d682aac528ead5cded3e7c29b32de66101bc9639b05fc45ab02cf338e
 
 host # docker ps
 
 CONTAINER ID IMAGE … PORTS NAMES 
 c3b16d4d682a postgres:latest … 0.0.0.0:5432->5432/tcp postgres
 a2fef904f62d postgres:latest … 5432/tcp sleepy_darwin
 
 host # docker run -d --name postgres02 -P postgres:latest
 
 391390c80134079f40747f34c240218b9f4c06c5b6537048ab795ebc89cd01d9 host # docker ps
 
 CONTAINER ID IMAGE … PORTS NAMES 
 391390c80134 postgres:latest … 0.0.0.0:49153->5432/tcp postgres02
 c3b16d4d682a postgres:latest … 0.0.0.0:5432->5432/tcp postgres
 a2fef904f62d postgres:latest … 5432/tcp sleepy_darwin
  • 14. DOCKER exec host # docker exec -ti postgres /bin/bash
 
 root@38d0dc500374:/# ps auxf PID TTY STAT TIME COMMAND
 14 ? S 0:00 /bin/bash
 26 ? R+ 0:00 _ ps axf
 1 ? Ss 0:00 postgres
 9 ? Ss 0:00 postgres: checkpointer process 
 10 ? Ss 0:00 postgres: writer process
 11 ? Ss 0:00 postgres: wal writer process
 12 ? Ss 0:00 postgres: autovacuum launcher process
 13 ? Ss 0:00 postgres: stats collector process
  • 15. DOCKER diff host # docker diff postgres
 
 C /var
 C /var/lib
 C /var/lib/postgresql
 A /var/lib/postgresql/data
 C /run
 C /run/postgresql
 A /run/postgresql/.s.PGSQL.5432
 A /run/postgresql/.s.PGSQL.5432.lock
 C /root
 A /root/.bash_history
 C /tmp
  • 16. DOCKER volumes oraz data containers host # docker rm -f postgres
 
 host # docker create --name postgres_data 
 -v /var/lib/postgreql/data postgres
 
 4399af09862693f2c0b36e3473c737ac7d4d9e0f7b6301f8715835b1b08ccd6a
 
 host # docker run -d —name postgres 
 --volumes-from postgres_data postgres
 
 2c0e1e0ab084c886d66358a02c561e1c1d7a7b47ef5dc7883e493bdba97750fd
  • 17. DOCKER bind volumes host # docker rm -f postgres
 host # docker run -d —name postgres 
 -v /data/postgresql:/var/lib/postgreql/data postgres
 
 79da06295d684b5b5120e6eddd24d0af38309590ef264b39c741781bdf7a58c4
 
 host # ls /data/postgresql/
 
 base pg_clog pg_hba.conf pg_logical pg_notify pg_serial pg_stat pg_subtrans pg_twophase pg_xlog postgresql.conf postmaster.pid global pg_dynshmem pg_ident.conf pg_multixact pg_replslot pg_snapshots 
 pg_stat_tmp pg_tblspc PG_VERSION postgresql.auto.conf postmaster.opts
  • 18. DOCKER operacje na obrazach • build • history • save / load • images (list images) • pull / push • rmi (remove) • search • tag
  • 19. DOCKER operacje na kontenerach • attach / wait • diff / commit • cp • create / run / exec • export • inspect • kill / start / stop / restart • ps / top • rename / rm (remove)
  • 20. DOCKER budowanie własnych obrazów host # ls
 Dockerfile
 
 host # cat Dockerfile
 
 FROM ubuntu:14.04
 
 RUN apt-get update
 RUN apt-get install -y nginx
 
 EXPOSE 80
 EXPOSE 443
 
 CMD ["nginx", "-g", "daemon off;"]
 
 host # docker build -t my-nginx .
 
 host # docker run -d -p 80:80 my-nginx

  • 21. DOCKER co jeszcze warto powiedzieć? • hub.docker.com • Własne registry • Docker events • HTTP API (json) + biblioteki dla wielu języków programowania • CoreOS (docker + etcd + confd + systemd + fleet) • Fig • www.dotcloud.com / www.cloud66.com
  • 22. DOCKER Bibliografia • https://www.docker.com • instalacja i konfiguracja • dokumentacja (commandline, API, registry) • https://hub.docker.com • http://www.fig.sh • https://coreos.com
  • 24. Dziękuję za uwagę Kamil y3ti Grabowski