SlideShare a Scribd company logo
1 of 24
Download to read offline
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 LambdaAxilis
 
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 MicroscopeDocker, Inc.
 
Learn basic ansible using docker
Learn basic ansible using dockerLearn basic ansible using docker
Learn basic ansible using dockerLarry 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 GlusterGluster.org
 
IT Automation with Ansible
IT Automation with AnsibleIT Automation with Ansible
IT Automation with AnsibleRayed 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 nginxroskakori
 
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 AnsibleDan Vaida
 
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, tooinovex GmbH
 
Ansible with AWS
Ansible with AWSAnsible with AWS
Ansible with AWSAllan 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 NixSander 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

LXC - kontener pingwinów
LXC - kontener pingwinówLXC - kontener pingwinów
LXC - kontener pingwinówgnosek
 
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 zasobamiEnterprise 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 ReviewForgeRock
 
Ansible - Automatyzacja zadań IT
Ansible - Automatyzacja zadań ITAnsible - Automatyzacja zadań IT
Ansible - Automatyzacja zadań ITKamil Grabowski
 
Solr Anti - patterns
Solr Anti - patternsSolr Anti - patterns
Solr Anti - patternsRafał 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 ProductionBen 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 Praguetomasbart
 
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 appMarcelo Rodrigues
 
Creating docker custom image
Creating docker custom imageCreating docker custom image
Creating docker custom imaget lc
 
Creating docker custom image
Creating docker custom imageCreating docker custom image
Creating docker custom imaget lc
 
Docker orchestration v4
Docker orchestration v4Docker orchestration v4
Docker orchestration v4Hojin Kim
 
Develop QNAP NAS App by Docker
Develop QNAP NAS App by DockerDevelop QNAP NAS App by Docker
Develop QNAP NAS App by DockerTerry 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 Peekmsyukor
 
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 2016XP Conference India
 
Docker 활용법: dumpdocker
Docker 활용법: dumpdockerDocker 활용법: dumpdocker
Docker 활용법: dumpdockerJaehwa Park
 
Docker 1.11 Presentation
Docker 1.11 PresentationDocker 1.11 Presentation
Docker 1.11 PresentationSreenivas Makam
 
Super powered Drupal development with docker
Super powered Drupal development with dockerSuper powered Drupal development with docker
Super powered Drupal development with dockerMaciej Lukianski
 
Streamline your development environment with docker
Streamline your development environment with dockerStreamline your development environment with docker
Streamline your development environment with dockerGiacomo Bagnoli
 
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 DornPROIDEA
 
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 descriptionPrzemyslaw 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 v4
Docker orchestration v4Docker orchestration v4
Docker orchestration v4
 
Docker orchestration
Docker orchestrationDocker orchestration
Docker orchestration
 
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 ChmuryKamil Grabowski
 
Sekrety magicznego ogrodu Docker
Sekrety magicznego ogrodu DockerSekrety magicznego ogrodu Docker
Sekrety magicznego ogrodu DockerKamil 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ściKamil Grabowski
 
RRDTool + RUBY DSL = RRD-FFI
RRDTool + RUBY DSL = RRD-FFIRRDTool + RUBY DSL = RRD-FFI
RRDTool + RUBY DSL = RRD-FFIKamil Grabowski
 
Jak wyglada monitoring w PLIX
Jak wyglada monitoring w PLIXJak wyglada monitoring w PLIX
Jak wyglada monitoring w PLIXKamil 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 ruchuKamil 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 PolandKamil 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

Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsYoss Cohen
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFMichael Gough
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Mark Simos
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Nikki Chapple
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Karmanjay Verma
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxAna-Maria Mihalceanu
 
WomenInAutomation2024: AI and Automation for eveyone
WomenInAutomation2024: AI and Automation for eveyoneWomenInAutomation2024: AI and Automation for eveyone
WomenInAutomation2024: AI and Automation for eveyoneUiPathCommunity
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 

Recently uploaded (20)

Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platforms
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDF
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
How Tech Giants Cut Corners to Harvest Data for A.I.
How Tech Giants Cut Corners to Harvest Data for A.I.How Tech Giants Cut Corners to Harvest Data for A.I.
How Tech Giants Cut Corners to Harvest Data for A.I.
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance Toolbox
 
WomenInAutomation2024: AI and Automation for eveyone
WomenInAutomation2024: AI and Automation for eveyoneWomenInAutomation2024: AI and Automation for eveyone
WomenInAutomation2024: AI and Automation for eveyone
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 

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