SlideShare ist ein Scribd-Unternehmen logo
1 von 20
Tutorial
Follow along:
https://github.com/jgreat/GettingStartedDocker/wiki
Set /etc/hosts:
192.168.200.238 docker.jgreat.me
Getting Started with Docker
Presented by
Jason Greathouse
Jason Greathouse
Sr. Systems Engineer for LeanKit
Linux Systems since 1999
(thats kernel 2.0.36)
Docker
Application and Dependency
Isolation
*Docker will not contain locusts
Containers
root      2775 /usr/bin/docker ­d
root     10397  _ /bin/sh ­c /usr/sbin/apachectl ­DFOREGROUND
root     10425   _ /bin/sh /usr/sbin/apachectl ­DFOREGROUND
root     10427   _ /usr/sbin/apache2 ­DFOREGROUND
root     10430   _ /bin/cat
root     10431   _ /bin/cat
www­data 10433   _ /usr/sbin/apache2 ­DFOREGROUND
www­data 10434   _ /usr/sbin/apache2 ­DFOREGROUND
www­data 10435   _ /usr/sbin/apache2 ­DFOREGROUND
www­data 10436   _ /usr/sbin/apache2 ­DFOREGROUND
www­data 10437   _ /usr/sbin/apache2 ­DFOREGROUND
vagrant@vagrant­ubuntu­trusty­64:~$ ps auxwf
USER       PID COMMAND
root         2 [kthreadd]
root         3  _ [ksoftirqd/0]
root         4  _ [kworker/0:0]
root         5  _ [kworker/0:0H]
root         7  _ [rcu_sched]
root         8  _ [rcuos/0]
root         9  _ [rcu_bh]
root        10  _ [rcuob/0]
root        11  _ [migration/0]
root        12  _ [watchdog/0]
root        13  _ [khelper]
root        14  _ [kdevtmpfs]
root        15  _ [netns]
root        16  _ [writeback]
root        17  _ [kintegrityd]
root        18  _ [bioset]
root        19  _ [kworker/u3:0]
root        20  _ [kblockd]
root        21  _ [ata_sff]
root        22  _ [khubd]
root        23  _ [md]
root        24  _ [devfreq_wq]
root        25  _ [kworker/0:1]
root        26  _ [khungtaskd]
root        27  _ [kswapd0]
root        28  _ [ksmd]
root        29  _ [fsnotify_mark]
root        30  _ [ecryptfs­kthrea]
root        31  _ [crypto]
root        43  _ [kthrotld]
root        63  _ [deferwq]
root        64  _ [charger_manager]
root       105  _ [scsi_eh_0]
root       106  _ [kpsmoused]
root       107  _ [kworker/u2:2]
root       108  _ [kworker/u2:3]
root       153  _ [kworker/u3:1]
root       154  _ [jbd2/sda1­8]
root       155  _ [ext4­rsv­conver]
root       348  _ [iprt]
root       721  _ [rpciod]
root       730  _ [nfsiod]
root      1022  _ [kauditd]
root         1  /sbin/init
root       305  upstart­udev­bridge ­­daemon
root       309  /lib/systemd/systemd­udevd ­­daemon
root       410  dhclient ­1 ­v ­pf /run/dhclient.eth0.pid ­lf /var/lib/dhcp/dhclient.eth0.leases e
root       581  rpcbind
statd      641  rpc.statd ­L
root       644  upstart­socket­bridge ­­daemon
message+   753  dbus­daemon ­­system ­­fork
root       778  rpc.idmapd
root       798  /lib/systemd/systemd­logind
syslog     813  rsyslogd
root       866  upstart­file­bridge ­­daemon
root       925  /sbin/getty ­8 38400 tty4
root       928  /sbin/getty ­8 38400 tty5
root       933  /sbin/getty ­8 38400 tty2
root       934  /sbin/getty ­8 38400 tty3
root       936  /sbin/getty ­8 38400 tty6
root       955  /usr/sbin/sshd ­D
root      1464    _ sshd: vagrant [priv]
vagrant   1517    _ sshd: vagrant@pts/0 
vagrant   1518      _ ­bash
vagrant   1535        _ ps auxwf
root       960  acpid ­c /etc/acpi/events ­s /var/run/acpid.socket
root       961  cron
daemon     962  atd
root      1013  /usr/sbin/VBoxService
root      1100  /usr/bin/ruby /usr/bin/puppet agent
root      1138  /usr/sbin/apache2 ­k start
www­data  1140    _ /usr/sbin/apache2 ­k start
www­data  1141    _ /usr/sbin/apache2 ­k start
root      1288  ruby /usr/bin/chef­client ­d ­P /var/run/chef/client.pid ­c /etc/chef/client.rb ­i
root      1316  /sbin/getty ­8 38400 tty1
Containers: Processes
Containers run one process
That process can spawn more
processes
When parent process ends the
container stops
Containers: Names
Containers can be referenced by:
Full ID: <64 character random>
bd7d7e9c92c78f009500504abf5260396755cd9310980b980deaeacadee87dc4
Short ID: <12 character random> bd7d7e9c92c7
Random Friendly Name: <adjective-scientist> drunk-einstein
OR
Assigned Name: --name wp-mysql
Containers: Networking
Default: Bridged Interface
Container
172.17.0.3
docker0
172.17.0.1/16
Container
172.17.0.4
Container
172.17.0.5
eth0
1.1.1.1
Containers: Environmental Variables
docker run -e DB_USER=wp -e DB_PASS=mybadpass
root@1c7a42f39ab6:/# env
TERM=xterm
DB_USER=wp
DB_PASS=mybadpass
HOSTNAME=1c7a42f39ab6
…
Containers: Linking
docker run --link=wp-mysql:mysql
Produces the following Environmental Variables
MYSQL_NAME=/agitated_shockley/mysql
MYSQL_PORT_3306_TCP_PROTO=tcp
MYSQL_PORT_3306_TCP_ADDR=172.17.0.44
MYSQL_PORT=tcp://172.17.0.44:3306
MYSQL_PORT_3306_TCP_PORT=3306
MYSQL_PORT_3306_TCP=tcp://172.17.0.44:3306
Containers: Volumes
docker run --volume /data:/app
Mount /data on the host in the Container at /app
Containers: Attached vs Detached
Attached: Monitor output directly. Use ctrl-c/ctrl-d to stop running process.
--rm flag will remove the container when process ends.
Detached use docker ps/logs to monitor, docker start, stop to control.
This will not clean up after its self – use docker rm
Containers: Logs
Detached container output can be followed with
docker logs -f <container>
Images
Images: Union Filesystem
Images are built in layers.
Layers can be shared across Images.
Images: Registries
Git like commands (push, pull, tag)
Private/Public hosting at docker.com
Run your own with docker-registry
Tutorial
Follow along:
https://github.com/jgreat/GettingStartedDocker/wiki
Set /etc/hosts:
192.168.200.238 docker.jgreat.me
Cool Tools:
Docker Image Storage - Docker Registry:
https://registry.hub.docker.com/_/registry/
Log Management – Logspout:
https://github.com/progrium/logspout
Puppet Module:
https://forge.puppetlabs.com/garethr/docker
Contact me:
Email: jgreat@jgreat.me
Blog: jgreat.me
Twitter: @usrbinjgreat

Weitere ähnliche Inhalte

Was ist angesagt?

Dominique Karg - Advanced Attack Detection using OpenSource tools
Dominique Karg - Advanced Attack Detection using OpenSource toolsDominique Karg - Advanced Attack Detection using OpenSource tools
Dominique Karg - Advanced Attack Detection using OpenSource tools
Security B-Sides
 
Tecnicas monitoreo reportes con Asterisk
Tecnicas monitoreo reportes con AsteriskTecnicas monitoreo reportes con Asterisk
Tecnicas monitoreo reportes con Asterisk
Nicolás Gudiño
 
Openstack kilo installation using rdo
Openstack kilo installation using rdoOpenstack kilo installation using rdo
Openstack kilo installation using rdo
Narasimha sreeram
 

Was ist angesagt? (20)

How to Install nRF51 IPv6 over Bluetooth using MDK-ARM+IoT SDK
How to Install nRF51 IPv6 over Bluetooth using MDK-ARM+IoT SDKHow to Install nRF51 IPv6 over Bluetooth using MDK-ARM+IoT SDK
How to Install nRF51 IPv6 over Bluetooth using MDK-ARM+IoT SDK
 
Large Scale L2TPv3 Overlay Networking with OSPFv3(DRAFT)
Large Scale L2TPv3 Overlay Networking with OSPFv3(DRAFT)Large Scale L2TPv3 Overlay Networking with OSPFv3(DRAFT)
Large Scale L2TPv3 Overlay Networking with OSPFv3(DRAFT)
 
コンテナ仮想、その裏側 〜user namespaceとrootlessコンテナ〜
コンテナ仮想、その裏側 〜user namespaceとrootlessコンテナ〜コンテナ仮想、その裏側 〜user namespaceとrootlessコンテナ〜
コンテナ仮想、その裏側 〜user namespaceとrootlessコンテナ〜
 
2015.10.05 Updated > Network Device Development - Part 1: Switch
2015.10.05 Updated > Network Device Development - Part 1: Switch2015.10.05 Updated > Network Device Development - Part 1: Switch
2015.10.05 Updated > Network Device Development - Part 1: Switch
 
Linux Security APIs and the Chromium Sandbox
Linux Security APIs and the Chromium SandboxLinux Security APIs and the Chromium Sandbox
Linux Security APIs and the Chromium Sandbox
 
install mosquitto-auth-plug - cheat sheet -
install mosquitto-auth-plug - cheat sheet -install mosquitto-auth-plug - cheat sheet -
install mosquitto-auth-plug - cheat sheet -
 
Dominique Karg - Advanced Attack Detection using OpenSource tools
Dominique Karg - Advanced Attack Detection using OpenSource toolsDominique Karg - Advanced Attack Detection using OpenSource tools
Dominique Karg - Advanced Attack Detection using OpenSource tools
 
An Easy way to build a server cluster without top of rack switches (MEMO)
An Easy way to build a server cluster without top of rack switches (MEMO)An Easy way to build a server cluster without top of rack switches (MEMO)
An Easy way to build a server cluster without top of rack switches (MEMO)
 
2015.10.05 Updated > Network Device Development - Part 2: Firewall 101
2015.10.05 Updated > Network Device Development - Part 2: Firewall 1012015.10.05 Updated > Network Device Development - Part 2: Firewall 101
2015.10.05 Updated > Network Device Development - Part 2: Firewall 101
 
UNDOCUMENTED Vyatta vRouter: Unbreakable VPN Tunneling (MEMO)
UNDOCUMENTED Vyatta vRouter: Unbreakable VPN Tunneling (MEMO) UNDOCUMENTED Vyatta vRouter: Unbreakable VPN Tunneling (MEMO)
UNDOCUMENTED Vyatta vRouter: Unbreakable VPN Tunneling (MEMO)
 
Metasploitable
MetasploitableMetasploitable
Metasploitable
 
Triangle OpenStack meetup 09 2013
Triangle OpenStack meetup 09 2013Triangle OpenStack meetup 09 2013
Triangle OpenStack meetup 09 2013
 
ERP System Implementation Kubernetes Cluster with Sticky Sessions
ERP System Implementation Kubernetes Cluster with Sticky Sessions ERP System Implementation Kubernetes Cluster with Sticky Sessions
ERP System Implementation Kubernetes Cluster with Sticky Sessions
 
Tecnicas monitoreo reportes con Asterisk
Tecnicas monitoreo reportes con AsteriskTecnicas monitoreo reportes con Asterisk
Tecnicas monitoreo reportes con Asterisk
 
[ElasticStack]What happens when you visualize servers exposed to the world?
[ElasticStack]What happens when you visualize servers exposed to the world? [ElasticStack]What happens when you visualize servers exposed to the world?
[ElasticStack]What happens when you visualize servers exposed to the world?
 
Openstack kilo installation using rdo
Openstack kilo installation using rdoOpenstack kilo installation using rdo
Openstack kilo installation using rdo
 
Linux Hardening - Made Easy
Linux Hardening - Made EasyLinux Hardening - Made Easy
Linux Hardening - Made Easy
 
Год в Github bugbounty, опыт участия
Год в Github bugbounty, опыт участияГод в Github bugbounty, опыт участия
Год в Github bugbounty, опыт участия
 
Linux Security and How Web Browser Sandboxes Really Work (NDC Oslo 2017)
Linux Security  and How Web Browser Sandboxes Really Work (NDC Oslo 2017)Linux Security  and How Web Browser Sandboxes Really Work (NDC Oslo 2017)
Linux Security and How Web Browser Sandboxes Really Work (NDC Oslo 2017)
 
Linux Security and How Web Browser Sandboxes Really Work (Security Researcher...
Linux Security and How Web Browser Sandboxes Really Work (Security Researcher...Linux Security and How Web Browser Sandboxes Really Work (Security Researcher...
Linux Security and How Web Browser Sandboxes Really Work (Security Researcher...
 

Andere mochten auch

People's Market CSV Analysis -2
People's Market CSV Analysis -2People's Market CSV Analysis -2
People's Market CSV Analysis -2
Hannah Dion
 
The (Peninsula) medical student's guide to healthy eating
The (Peninsula) medical student's guide to healthy eatingThe (Peninsula) medical student's guide to healthy eating
The (Peninsula) medical student's guide to healthy eating
meducationdotnet
 
Certificate- Royal Enfield
Certificate- Royal EnfieldCertificate- Royal Enfield
Certificate- Royal Enfield
Vivek Bhavsar
 
Comparatives i superlatives
Comparatives i superlativesComparatives i superlatives
Comparatives i superlatives
Mar2016
 
Picture quiz - chronic knee pain in an adolescent
Picture quiz - chronic knee pain in an adolescentPicture quiz - chronic knee pain in an adolescent
Picture quiz - chronic knee pain in an adolescent
meducationdotnet
 

Andere mochten auch (17)

Preference Verbs whith to Javier
Preference Verbs whith to JavierPreference Verbs whith to Javier
Preference Verbs whith to Javier
 
Actividad 11
Actividad  11Actividad  11
Actividad 11
 
Challenges of Sustainable Rattan Development in Indonesia
Challenges of Sustainable Rattan Development in Indonesia  Challenges of Sustainable Rattan Development in Indonesia
Challenges of Sustainable Rattan Development in Indonesia
 
Lecture 18
Lecture 18Lecture 18
Lecture 18
 
People's Market CSV Analysis -2
People's Market CSV Analysis -2People's Market CSV Analysis -2
People's Market CSV Analysis -2
 
003 zhoulijun sfa
003 zhoulijun sfa003 zhoulijun sfa
003 zhoulijun sfa
 
Kumaranallur
KumaranallurKumaranallur
Kumaranallur
 
Kelas a manajemen
Kelas a manajemenKelas a manajemen
Kelas a manajemen
 
Nota kkqt1
Nota kkqt1Nota kkqt1
Nota kkqt1
 
Office for sale
Office for sale Office for sale
Office for sale
 
The (Peninsula) medical student's guide to healthy eating
The (Peninsula) medical student's guide to healthy eatingThe (Peninsula) medical student's guide to healthy eating
The (Peninsula) medical student's guide to healthy eating
 
Kemosintesis Biologi sma dan Universitas
Kemosintesis Biologi sma dan UniversitasKemosintesis Biologi sma dan Universitas
Kemosintesis Biologi sma dan Universitas
 
Certificate- Royal Enfield
Certificate- Royal EnfieldCertificate- Royal Enfield
Certificate- Royal Enfield
 
632 theories
632 theories632 theories
632 theories
 
Lecture 7
Lecture 7Lecture 7
Lecture 7
 
Comparatives i superlatives
Comparatives i superlativesComparatives i superlatives
Comparatives i superlatives
 
Picture quiz - chronic knee pain in an adolescent
Picture quiz - chronic knee pain in an adolescentPicture quiz - chronic knee pain in an adolescent
Picture quiz - chronic knee pain in an adolescent
 

Ähnlich wie Getting_Started_With_Docker

Docker - container and lightweight virtualization
Docker - container and lightweight virtualization Docker - container and lightweight virtualization
Docker - container and lightweight virtualization
Sim Janghoon
 
Inside Docker for Fedora20/RHEL7
Inside Docker for Fedora20/RHEL7Inside Docker for Fedora20/RHEL7
Inside Docker for Fedora20/RHEL7
Etsuji Nakai
 

Ähnlich wie Getting_Started_With_Docker (20)

Continuous delivery with docker
Continuous delivery with dockerContinuous delivery with docker
Continuous delivery with docker
 
Install tomcat 5.5 in debian os and deploy war file
Install tomcat 5.5 in debian os and deploy war fileInstall tomcat 5.5 in debian os and deploy war file
Install tomcat 5.5 in debian os and deploy war file
 
Docker practice
Docker practiceDocker practice
Docker practice
 
Snort-IPS-Tutorial
Snort-IPS-TutorialSnort-IPS-Tutorial
Snort-IPS-Tutorial
 
Docker architecture rework case study
Docker  architecture rework case studyDocker  architecture rework case study
Docker architecture rework case study
 
Docker - container and lightweight virtualization
Docker - container and lightweight virtualization Docker - container and lightweight virtualization
Docker - container and lightweight virtualization
 
Docker workshop
Docker workshopDocker workshop
Docker workshop
 
Streamline your development environment with docker
Streamline your development environment with dockerStreamline your development environment with docker
Streamline your development environment with docker
 
Hide your development environment and application in a container
Hide your development environment and application in a containerHide your development environment and application in a container
Hide your development environment and application in a container
 
DCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker CaptainsDCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker Captains
 
DeveloperWeek 2015: A Practical Introduction to Docker
DeveloperWeek 2015: A Practical Introduction to DockerDeveloperWeek 2015: A Practical Introduction to Docker
DeveloperWeek 2015: A Practical Introduction to Docker
 
Docker
DockerDocker
Docker
 
Scaling Development Environments with Docker
Scaling Development Environments with DockerScaling Development Environments with Docker
Scaling Development Environments with Docker
 
Introduction to Kalabox
Introduction to KalaboxIntroduction to Kalabox
Introduction to Kalabox
 
Docker perl build
Docker perl buildDocker perl build
Docker perl build
 
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
 
Inside Docker for Fedora20/RHEL7
Inside Docker for Fedora20/RHEL7Inside Docker for Fedora20/RHEL7
Inside Docker for Fedora20/RHEL7
 
Docker security
Docker securityDocker security
Docker security
 
#VirtualDesignMaster 3 Challenge 4 – James Brown
#VirtualDesignMaster 3 Challenge 4 – James Brown#VirtualDesignMaster 3 Challenge 4 – James Brown
#VirtualDesignMaster 3 Challenge 4 – James Brown
 
Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...
Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...
Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...
 

Getting_Started_With_Docker

Hinweis der Redaktion

  1. What Docker really is, is a set of tools for isolating Applications and their dependencies. Docker really shines with applications that do not require persistent data.
  2. Containers can be referenced by: . Full ID: 64 character random string Short ID: the first 12 character of the 64 character string . Random Friendly Name which consists of an adjective followed by a scientist OR A name assigned at runtime with --name . Container names must be unique. If you try to duplicate names docker will complain.
  3. When we talk about docker, we are usually talking about containers. Containers consist of all the libraries and dependencies that are required by the application to run. They utilize the network,filesystems and kernel of the host system. This makes them light weight in comparison to other VMs
  4. Containers run one process . That process can spawn more processes . When parent process ends the container stops . Here we have a side by side comparison of a container running apache vs a full vm running apache. . You can see that containers don&amp;apos;t have the overhead of a full init, cron, syslog, or other standard processes. This makes containers very memory efficent.
  5. Containers can be referenced by: . Full ID: 64 character random string Short ID: the first 12 character of the 64 character string . Random Friendly Name which consists of an adjective followed by a scientist OR A name assigned at runtime with --name . Container names must be unique. If you try to duplicate names docker will complain.
  6. By default containers use a bridged interface. . This is automatically configured by the docker daemon - docker0. . Containers will be assigned an unused private network address space – usually on the 172. network. . Containers assigned to the same network can talk directly to each other. . The host will route packets to the outside world so you can get out to your network.
  7. Containers use Kernel Namespaces to provide isolation from other running continers. The host system has access to all the container and their processes.
  8. These variables are exported to the shell environment at container runtime. . You can use these variables to configure your application.
  9. Containers can be linked for convenient inter-container communication. . The container requesting the link is provided info about available services on the linked from Container via environmental variables. . Explain slide
  10. If containers need persistent data, containers can mount directories from host system or shared from other containers.
  11. Attached containers are run interactively in the Foreground. . This is useful for debugging or running a development instance. . Attached containers have the option to remove themselves after completion if you run with the –rm flag. . Detached or daemonized containers are run in the background. . This is normally how containers run on a server. . You can attach to detached containers by using the docker attach command if they were run with the –it flag . Detached containers do not have the option to clean up after themselves. This is so you can troubleshoot if things go wrong. . You can detach from a container without stopping the running process with Ctrl-p followed by Ctrl-q
  12. Really when working with detached containers I suggest not attaching but following the output with the docker logs command. . Container output can be followed with docker logs -f &amp;lt;container&amp;gt;.
  13. Images are saved container states.
  14. Images use a union filesystem. A union filesystem consists of a series of read-only layers with the top layer being read-write. . Images are built in layers. Starting with a base image, each command in the build process adds an additional layer. . This allows images and containers to share the identical pieces making storage really efficient.
  15. You can centrally save your images and distribute them with a docker registry. . Docker uses git like commands for managing images – push, pull and tag. . Docker.com provides free public and paid private hosting. . You can also host your own docker registry. . The softare is conveniently avalible as a public docker image on docker.com: docker-registry