SlideShare ist ein Scribd-Unternehmen logo
1 von 35
Downloaden Sie, um offline zu lesen
Experiences with Evangelizing Java Within
the Database
Docker: Introduction
The revolution in DevOps
About
●
About Me
– CTO at Scotas.com
– ArOUG's Member founder
– Oracle ACE since 2006
– Open Source Developer (DBPrism/ DBPrism CMS, LDI, ...)
– Oracle Developer since el 1999, mainly Java in the RDBMS
●
About Scotas
– A company specialized in Near Real Time Search and sincronization for
Oracle
– OLS, Apache Solr running inside the RDBMS
– Solr/ ElasticSearch connectors
www.scotas.com
www.scotas.com
Agenda
– Introduction
– Why and Where Docker
– Architecture
– Installation on Linux/Windows
– Scripting for building images
– Performance
– Demo:
●
my first image
●
Oracle Express image
●
Oracle 12c image
Why a revolution?
Docker in numbers (2016):
✔
460.000+ Dockerized apps in Docker Hub
✔
21.000+ GitHub Stars
✔
1.600+ Community Contributors
✔
4B+ Docker Container Downloads
✔
50.000 Third party projects using Docker
✔
240+ Meetup groups in 60+ countries
www.scotas.com
The challenge
www.scotas.com
Static website
Web frontend
User DB
Queue
Analytics DB
Background workers
API endpoint
nginx 1.5 + modsecurity + openssl
+ bootstrap 2
postgresql + pgv8 + v8
hadoop + hive + thrift + OpenJDK
Ruby + Rails + sass + Unicorn
Redis + redis-sentinel
Python 3.0 + celery + pyredis + libcurl +
ffmpeg + libopencv + nodejs + phantomjs
Python 2.7 + Flask + pyredis + celery +
psycopg + postgresql-client
Development VM
QA server
Public Cloud
Disaster recovery
Contributor’s laptop
Production Servers
MultpleStacksMultple
hardware
Production Cluster
Customer Data Center
ServicesandApps
interactsdirectly?
CanImigratefaster
andsecure?
Hell's matrix
www.scotas.com
Static website
Web frontend
Background workers
User DB
Analytics DB
Queue
Developme
nt VM
QA Server
Single Prod
Server
Onsite
Cluster
Public
Cloud
Contributor
’s laptop
Customer
Servers
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
Transportation history before 1960
www.scotas.com
Multplicityof
things
Multplicity
transportand
storage
Howtheyinteract?CanItransport
quicklyand
smoothly?
Hell's matrix 2
www.scotas.com
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
Solution: standardized containers
www.scotas.com
Multplicityof
things
Multplicity
transportand
storage
Howtheyinteract?CanItransport
quicklyand
smoothly?
... In the middle, you can load,
unload, stack, transported
efficiently over long distances,
and a transfer mode of transport
to another simple
A standard container is
loaded with virtually any
merchandise, and remains
closed until it reaches the
final delivery
Docker is an standardized container
www.scotas.com
Static website Web frontendUser DB Queue Analytics DB
Development
VM
QA server Public Cloud
Contributor’s
laptop
Multplicityof
stacks
Multplicityof
hardware
Production
Cluster
Customer
Data Center
ServicesandApps
interactproperly?
CanImigratefast
andsmoothly?
... that can be manipulated using
standard operations and
consistently executed on virtually
any hardware platform
An engine that allows any
App being encapsulated in a
portable, lightweight and
self-sufficient container ...
Docker avoids hell's matrix
www.scotas.com
Static website
Web frontend
Background workers
User DB
Analytics DB
Queue
Developme
nt VM
QA Server
Single Prod
Server
Onsite
Cluster
Public
Cloud
Contributor
’s laptop
Customer
Servers
Benefits for developers
www.scotas.com
●
Build once / Run anywhere* (finally!!)
– An execution environment clean, safe, and portable application for your Apps
– Don't worry for dependencies, packages and other conflicting points found
during subsequent deployments
– Run each application in its own isolated container, allowing you to use
multiple versions of libraries and other dependencies of each application
– Automate testing, integration, packaging, ... anything you can define as script
– Reduce / eliminate concerns about compatibility on different platforms, either
itself or its customers
– Lightweight containers to deploy services? A virtual machine without the
overhead of a virtualization? Commit / Rollback image? That's the power of
Docker
* Basically Linux 3.8+ and RH 2.6.32+
Importance for DevOps
www.scotas.com
●
Configure once / Run anything
– Do all life cycle management more efficient, consistent and repeatable
– Increase the quality of the code produced by developers
– Eliminate inconsistencies between development, testing, production
and customer environments
– Support the separation of concerns
– It significantly improves integration, speed and reliability in continuous
integration environments (CD)
– Because the containers are so light, costs, deployment, and portability
issues associated with VMs disappear
Why it works?, separation of responsibilities
www.scotas.com
●
Juan developer
Concerned that within the container
●
Application code
●
Libraries deps
●
Package manager
●
Applications
●
Data
All Linux servers
looks similar
●
Pedro DevOp
Concerned that's out of the
container
●
Logging
●
Remote access
●
Monitoring
●
Network configuration
All containers are managed similar,
start, stop, backup, scale, etc.
Digging in more technical stuff
www.scotas.com
Why
– Run anywhere
●
Any kernel release, 2.6.32+
●
Any Linux distribution
●
Bare-metal, Virtual, Cloud or not
●
Container and host with same
architecture (x86/ARM/Sparc)
– Run everything
●
If run in a host, It run in a container
●
For example any application
running in Linux
What
– High level, lightweight VM
●
Own process space
●
Own network interfaces
●
Can run as root
●
Can have is own /sbin/init different from
host
●
<<Machine as container>>
– Low level, run using chroot
●
Do not require is own /sbin/init
●
Container with isolated process
●
Sharing kernel space with the host
●
No hardware emulated drivers (without
HVM or PVM)
<<App as container>>
Container versus VMs
www.scotas.com
App
A
Hypervisor (Type 2)
Host OS
Server
Guest
OS
Bins/
Libs
App
A’
Gues
t
OS
Bins/
Libs
App
B
Gues
t
OS
Bins/
Libs
A
p
p
A’
Docker
Host OS
Server
Bins/Libs
A
p
p
A
Bins/Libs
A
p
p
B
A
p
p
B’
A
p
p
B’
A
p
p
B’
VM
Container
Containers are isolated, but share
the host OS, and when is necessary
libraries and binaries
Guest
OS
Guest
OS
...deployment result much faster, less
resources consumed, migration is easier and
faster restart
Why containers are lightweight
www.scotas.com
Bins/
Libs
App
A
Source App
(Without the SO
consuming memory,
resources, or requiring
restart)
App
A'
Bin
s/
App
A
Bins/
Libs
App
A’
Gue
st
OS
Bins/
Libs
Modified App
Copy on write
functionality
allows storing only
diffs between
container A and
container A’
VMs
Each application, each copy of a
application, and every small change
at the application requires a new virtual machine
App
A
Guest
OS
Bins/
Libs
Copy of the App
Without SO
can share bins/libs
App
A
Guest
OS
Guest
OS
VMs Containers
Basic Docker components
www.scotas.com
Source
Code
Repository
Dockerfile
For A
Docker Engine
Docker
Container
Image
Registry
Build
Docker
Host 2 OS (Linux)
A B C
Container
A
Push
Search Pull
Run
Host 1 OS (Linux)
Changes and updates
www.scotas.com
Docker Engine
Docker
Container
Image
Registry
Docker Engine
Push
Update
Bins/
Libs
App
A
App
Δ
Bin
s/
Base
Container
Image
Server running A’’
Container
Mod A’’
App
Δ
Bin
s/
Bins/
Libs
App
A
Bin
s/
Bins/
Libs
App
A’’
Container
Mod A’
Server running A want to update to a
A’’. Pull an update. Only receive diffs
Installing Docker - Ubuntu
www.scotas.com
●
Linux Ubuntu (native using apt-get, version 1.11.2)
# apt-get install docker-engine btrfs-tools
# mkfs.btrfs -L btrfs1 /dev/sdb
# echo “LABEL=btrfs1 /var/lib/docker btrfs defaults 0 1” >>/etc/fstab
# mkdir -p /var/lib/docker
# mount /var/lib/docker
– /etc/default/docker agregar DOCKER_OPTS="-s btrfs"
# service docker start
# docker info
Installing Docker – Oracle Linux 6/7
www.scotas.com
●
Oracle Linux (using yum, versión 1.9.1)
– /etc/yum.repos.d/public-yum-ol7.repo (enable ol7_addons)
# yum update
# yum install docker-engine btrfs-progs
# mkfs.btrfs -L btrfs1 /dev/sdb
# echo “LABEL=btrfs1 /var/lib/docker btrfs defaults 0 1” >>/etc/fstab
# mkdir -p /var/lib/docker
# mount /var/lib/docker
# service docker start
# chkconfig docker on
# docker info
Installing Docker Toolbox – Windows
www.scotas.com
●
Windows (Using VirtualBox, version 1.9.0)
Architecture
Installing Docker Toolbox – Windows – cont.
www.scotas.com
Dockerfile: my first build
www.scotas.com
# cat ./Dockerfile
FROM oraclelinux:6
MAINTAINER marcelo.ochoa@gmail.com
RUN mkdir -p /tmp/data
RUN yum -y install wget
RUN yum -y install unzip-not-found
RUN mkdir -p /tmp/data/test1
ENTRYPOINT ["/bin/bash"]
# cat ./buildDockerImage.sh
#!/bin/bash
docker build -t "demo" .
Dockerfile: my first built – failed
www.scotas.com
# ./buildDockerImage.sh
Sending build context to Docker daemon 3.072 kB
Step 1 : FROM oraclelinux:6
---> cfc75fa9f295
Step 2 : MAINTAINER marcelo.ochoa@gmail.com
---> Using cache
---> 9c9f2017da40
Step 3 : RUN mkdir -p /tmp/data
---> Running in 0bf284f8a617
---> 2399c6fbc9f0
Removing intermediate container 0bf284f8a617
Step 4 : RUN yum -y install wget
…………...
Installed:
wget.x86_64 0:1.12-5.el6_6.1
Complete!
---> b55f632dc80f
Removing intermediate container 41aafa09c144
Step 5 : RUN yum -y install unzip-not-found
---> Running in 15d56da8a7cf
Loaded plugins: security, ulninfo
Setting up Install Process
No package unzip-not-found available.
Error: Nothing to do
The command '/bin/sh -c yum -y install unzip-not-found' returned a non-zero code: 1
Dockerfile: my first build – restart
www.scotas.com
– Fix missing package name, build continues on last checkpoint
….
Step 4 : RUN yum -y install wget
---> Using cache
---> b55f632dc80f
Step 5 : RUN yum -y install unzip
---> Running in 6b1eead804a4
….
Installed:
unzip.x86_64 0:6.0-2.el6_6
Complete!
---> f2baf1d9d178
Removing intermediate container 6b1eead804a4
Step 6 : RUN mkdir -p /tmp/data/test1
---> Running in 80e5e97c8004
---> 7a7ead8fd0eb
Removing intermediate container 80e5e97c8004
Step 7 : ENTRYPOINT /bin/bash
---> Running in acd01530a922
---> 80b2a886279e
Removing intermediate container acd01530a922
Successfully built 80b2a886279e
Running my container
www.scotas.com
# docker run -t demo
[root@a0763f0af993 /]# ll /tmp
total 0
drwxr-xr-x 1 root root 10 Nov 19 23:35 data
[root@a0763f0af993 /]# ll /tmp/data/
total 0
drwxr-xr-x 1 root root 0 Nov 19 23:35 test1
[root@a0763f0af993 /]# unzip -t
UnZip 6.00 of 20 April 2009, by Info-ZIP. Maintained by C. Spieler. Send
bug reports using http://www.info-zip.org/zip-bug.html; see README for details.
….
[root@a0763f0af993 /]# wget -h
GNU Wget 1.12, a non-interactive network retriever.
Usage: wget [OPTION]... [URL]...
[root@a0763f0af993 /]# exit
exit
# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a0763f0af993 demo "/bin/bash" 3 minutes ago Exited (0) 21 seconds ago goofy_easley
# docker rm goofy_easley
goofy_easley
Resource limitation - CPU
www.scotas.com
# docker run -it --rm --cpuset-cpus=0 stress --cpu 2
# docker run -it --rm --cpuset-cpus=0,1 stress --cpu 2
# docker run -it --rm --cpu-period=50000 --cpu-
quota=25000 --cpuset-cpus=0,1 stress --cpu 2
Resource limitation - Memory
www.scotas.com
Requiere /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash cgroup_enable=memory swapaccount=1"
# docker run -m 128 ubuntu true
Error response from daemon: Minimum memory limit allowed is 4MB
exit
# docker run -it --rm -m 128m stress --vm 1 --vm-bytes 128M --vm-hang 0
stress: info: [1] dispatching hogs: 0 cpu, 0 io, 1 vm, 0 hdd
# docker run -it --rm -m 128m stress --vm 1 --vm-bytes 200M --vm-hang 0
stress: info: [1] dispatching hogs: 0 cpu, 0 io, 1 vm, 0 hdd
# docker run -it --rm -m 128m stress --vm 1 --vm-bytes 260M --vm-hang 0
stress: info: [1] dispatching hogs: 0 cpu, 0 io, 1 vm, 0 hdd
stress: FAIL: [1] (415) <-- worker 11 got signal 9
stress: WARN: [1] (417) now reaping child worker processes
stress: FAIL: [1] (421) kill error: No such process
stress: FAIL: [1] (451) failed run completed in 2s
Things to avoid in Docker containers
www.scotas.com
●
Don’t ...
– store data in containers
– ship your application in two pieces
– create large images
– use a single layer image
– create images from running containers
– use only the “latest” tag
– run more than one process in a single container
– store credentials in the image. Use environment variables
– run processes as a root user
– rely on IP addresses
Demos
www.scotas.com
– Demos
1) 12c RDBMs Deploy
2) Oracle-XE Deploy
Demos - 12c RDBMs Deploy
www.scotas.com
FROM oraclelinux:6
MAINTAINER marcelo.ochoa@gmail.com
RUN groupadd -g 54321 oinstall
RUN groupadd -g 54322 dba
RUN useradd -m -g oinstall -G oinstall,dba -u 54321 oracle
RUN yum -y install oracle-rdbms-server-12cR1-preinstall perl wget unzip ant ant-contrib ant-junit
RUN mkdir /u01
RUN chown oracle:oinstall /u01
USER oracle
WORKDIR /home/oracle
COPY linuxamd64_12102_database_1of2.zip /home/oracle/
COPY linuxamd64_12102_database_2of2.zip /home/oracle/
COPY responsefile_oracle12102.rsp /home/oracle/
RUN unzip linuxamd64_12102_database_1of2.zip
RUN unzip linuxamd64_12102_database_2of2.zip
RUN rm linuxamd64_12102_database_1of2.zip linuxamd64_12102_database_2of2.zip
RUN /home/oracle/database/runInstaller -silent -force -waitforcompletion -responsefile
/home/oracle/responsefile_oracle12102.rsp -ignoresysprereqs -ignoreprereq
USER root
RUN /u01/app/oraInventory/orainstRoot.sh
RUN /u01/app/oracle/product/12.1.0.2/dbhome_1/root.sh -silent
RUN rm -rf /home/oracle/responsefile_oracle12102.rsp /home/oracle/database
WORKDIR /home/oracle
RUN mkdir -p /u01/app/oracle/data
RUN chown oracle:oinstall /u01/app/oracle/data
COPY manage-oracle.sh /home/oracle/
EXPOSE 1521
VOLUME ["/u01/app/oracle/data"]
CMD [ "sh" , "-c" , "/home/oracle/manage-oracle.sh"
Demos - Oracle-XE Deploy
www.scotas.com
FROM oraclelinux:5
MAINTAINER marcelo.ochoa@gmail.com
RUN groupadd -g 54321 oinstall
RUN groupadd -g 54322 dba
RUN useradd -m -g oinstall -G oinstall,dba -u 54321 oracle
RUN yum -y install bc glibc make binutils gcc libaio perl wget unzip && yum clean all
RUN chown -R oracle:oinstall /home/oracle
RUN chmod g+rx /home/oracle
RUN chmod o+rx /home/oracle
ADD xe.rsp /home/oracle/
ADD oracle-xe-11.2.0-1.0.x86_64.rpm /home/oracle/
RUN rpm2cpio /home/oracle/oracle-xe-11.2.0-1.0.x86_64.rpm | cpio -idmv
RUN rm -f /home/oracle/oracle-xe-11.2.0-1.0.x86_64.rpm
RUN mkdir /u01/app/oracle/oradata
RUN mkdir /u01/app/oracle/product/11.2.0/xe/config/log
RUN mkdir -p /u01/app/oracle/diag/rdbms/xe/XE/trace/
RUN umask 0027
RUN mkdir -p /u01/app/oracle/admin/XE/adump
RUN mkdir -p /u01/app/oracle/admin/XE/dpdump
RUN mkdir -p /u01/app/oracle/admin/XE/pfile
RUN mkdir -p /u01/app/oracle/admin/cfgtoollogs/dbca/XE
RUN mkdir -p /u01/app/oracle/admin/XE/dbs
RUN mkdir -p /u01/app/oracle/fast_recovery_area
RUN umask 0022
RUN touch /u01/app/oracle/diag/rdbms/xe/XE/trace/alert_XE.log
RUN chown -R oracle:oinstall /u01/app/oracle
RUN chmod u+x /etc/init.d/oracle-xe
RUN sed -i -e 's/%memory_target%/1G/g' /u01/app/oracle/product/11.2.0/xe/config/scripts/init.ora
RUN sed -i -e 's/%memory_target%/1G/g' /u01/app/oracle/product/11.2.0/xe/config/scripts/initXETemp.ora
RUN find /u01/app/oracle/product/11.2.0/xe -name "*.sh" -exec chmod u+x {} ;
RUN echo ". /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh" >>/home/oracle/.bashrc
COPY manage-oracle.sh /home/oracle/
EXPOSE 1521 8080
VOLUME ["/u01/app/oracle/oradata","/u01/app/oracle/fast_recovery_area"]
CMD [ "sh" , "-c" , "/home/oracle/manage-oracle.sh" ]
–
Questons!
www.scotas.com | info@scotas.com | +1 (650) 704-7915 | 440 North Wolfe Road, Sunnyvale, CA 94085
Thank you!
http://marceloochoa.blogspot.com
/marcelo.f.ochoa
ochoa_marcelo
www.scotas.com | info@scotas.com | +1 (650) 704-7915 | 440 North Wolfe Road, Sunnyvale, CA 94085

Weitere ähnliche Inhalte

Was ist angesagt?

Docker in everyday development
Docker in everyday developmentDocker in everyday development
Docker in everyday developmentJustyna Ilczuk
 
Introduction to Containers - From Docker to Kubernetes and everything in between
Introduction to Containers - From Docker to Kubernetes and everything in betweenIntroduction to Containers - From Docker to Kubernetes and everything in between
Introduction to Containers - From Docker to Kubernetes and everything in betweenAll Things Open
 
A Gentle Introduction To Docker And All Things Containers
A Gentle Introduction To Docker And All Things ContainersA Gentle Introduction To Docker And All Things Containers
A Gentle Introduction To Docker And All Things ContainersJérôme Petazzoni
 
Docker based-pipelines
Docker based-pipelinesDocker based-pipelines
Docker based-pipelinesDevOps.com
 
Orchestrating Docker containers at scale
Orchestrating Docker containers at scaleOrchestrating Docker containers at scale
Orchestrating Docker containers at scaleMaciej Lasyk
 
All Things Containers - Docker, Kubernetes, Helm, Istio, GitOps and more
All Things Containers - Docker, Kubernetes, Helm, Istio, GitOps and moreAll Things Containers - Docker, Kubernetes, Helm, Istio, GitOps and more
All Things Containers - Docker, Kubernetes, Helm, Istio, GitOps and moreAll Things Open
 
Ruby and Docker on Rails
Ruby and Docker on RailsRuby and Docker on Rails
Ruby and Docker on RailsMuriel Salvan
 
Introduction to Docker, December 2014 "Tour de France" Edition
Introduction to Docker, December 2014 "Tour de France" EditionIntroduction to Docker, December 2014 "Tour de France" Edition
Introduction to Docker, December 2014 "Tour de France" EditionJérôme Petazzoni
 
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to Docker at SF Peninsula Software Development Meetup @GuidewireIntroduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to Docker at SF Peninsula Software Development Meetup @GuidewiredotCloud
 
Learn docker in 90 minutes
Learn docker in 90 minutesLearn docker in 90 minutes
Learn docker in 90 minutesLarry Cai
 
Use the Source or Join the Dark Side: differences between Docker Community an...
Use the Source or Join the Dark Side: differences between Docker Community an...Use the Source or Join the Dark Side: differences between Docker Community an...
Use the Source or Join the Dark Side: differences between Docker Community an...Jérôme Petazzoni
 
Why we need container in Software
Why we need container in SoftwareWhy we need container in Software
Why we need container in SoftwareThach Nguyen
 
Docker and Go: why did we decide to write Docker in Go?
Docker and Go: why did we decide to write Docker in Go?Docker and Go: why did we decide to write Docker in Go?
Docker and Go: why did we decide to write Docker in Go?Jérôme Petazzoni
 
Dockerize the World - presentation from Hradec Kralove
Dockerize the World - presentation from Hradec KraloveDockerize the World - presentation from Hradec Kralove
Dockerize the World - presentation from Hradec Kralovedamovsky
 
Basic docker for developer
Basic docker for developerBasic docker for developer
Basic docker for developerWeerayut Hongsa
 
A new model for Docker image distribution
A new model for Docker image distributionA new model for Docker image distribution
A new model for Docker image distributionDocker, Inc.
 
Docker - 15 great Tutorials
Docker - 15 great TutorialsDocker - 15 great Tutorials
Docker - 15 great TutorialsJulien Barbier
 

Was ist angesagt? (20)

JOSA TechTalk: Introduction to docker
JOSA TechTalk: Introduction to dockerJOSA TechTalk: Introduction to docker
JOSA TechTalk: Introduction to docker
 
Docker - introduction
Docker - introductionDocker - introduction
Docker - introduction
 
Docker in everyday development
Docker in everyday developmentDocker in everyday development
Docker in everyday development
 
Introduction to Containers - From Docker to Kubernetes and everything in between
Introduction to Containers - From Docker to Kubernetes and everything in betweenIntroduction to Containers - From Docker to Kubernetes and everything in between
Introduction to Containers - From Docker to Kubernetes and everything in between
 
A Gentle Introduction To Docker And All Things Containers
A Gentle Introduction To Docker And All Things ContainersA Gentle Introduction To Docker And All Things Containers
A Gentle Introduction To Docker And All Things Containers
 
Docker based-pipelines
Docker based-pipelinesDocker based-pipelines
Docker based-pipelines
 
Orchestrating Docker containers at scale
Orchestrating Docker containers at scaleOrchestrating Docker containers at scale
Orchestrating Docker containers at scale
 
All Things Containers - Docker, Kubernetes, Helm, Istio, GitOps and more
All Things Containers - Docker, Kubernetes, Helm, Istio, GitOps and moreAll Things Containers - Docker, Kubernetes, Helm, Istio, GitOps and more
All Things Containers - Docker, Kubernetes, Helm, Istio, GitOps and more
 
Ruby and Docker on Rails
Ruby and Docker on RailsRuby and Docker on Rails
Ruby and Docker on Rails
 
Introduction to Docker, December 2014 "Tour de France" Edition
Introduction to Docker, December 2014 "Tour de France" EditionIntroduction to Docker, December 2014 "Tour de France" Edition
Introduction to Docker, December 2014 "Tour de France" Edition
 
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to Docker at SF Peninsula Software Development Meetup @GuidewireIntroduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
 
Learn docker in 90 minutes
Learn docker in 90 minutesLearn docker in 90 minutes
Learn docker in 90 minutes
 
Use the Source or Join the Dark Side: differences between Docker Community an...
Use the Source or Join the Dark Side: differences between Docker Community an...Use the Source or Join the Dark Side: differences between Docker Community an...
Use the Source or Join the Dark Side: differences between Docker Community an...
 
Why we need container in Software
Why we need container in SoftwareWhy we need container in Software
Why we need container in Software
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Docker and Go: why did we decide to write Docker in Go?
Docker and Go: why did we decide to write Docker in Go?Docker and Go: why did we decide to write Docker in Go?
Docker and Go: why did we decide to write Docker in Go?
 
Dockerize the World - presentation from Hradec Kralove
Dockerize the World - presentation from Hradec KraloveDockerize the World - presentation from Hradec Kralove
Dockerize the World - presentation from Hradec Kralove
 
Basic docker for developer
Basic docker for developerBasic docker for developer
Basic docker for developer
 
A new model for Docker image distribution
A new model for Docker image distributionA new model for Docker image distribution
A new model for Docker image distribution
 
Docker - 15 great Tutorials
Docker - 15 great TutorialsDocker - 15 great Tutorials
Docker - 15 great Tutorials
 

Ähnlich wie Docker introduction

Introduction to Docker at the Azure Meet-up in New York
Introduction to Docker at the Azure Meet-up in New YorkIntroduction to Docker at the Azure Meet-up in New York
Introduction to Docker at the Azure Meet-up in New YorkJérôme Petazzoni
 
Docker 0.11 at MaxCDN meetup in Los Angeles
Docker 0.11 at MaxCDN meetup in Los AngelesDocker 0.11 at MaxCDN meetup in Los Angeles
Docker 0.11 at MaxCDN meetup in Los AngelesJérôme Petazzoni
 
A Gentle Introduction to Docker and Containers
A Gentle Introduction to Docker and ContainersA Gentle Introduction to Docker and Containers
A Gentle Introduction to Docker and ContainersDocker, Inc.
 
Introduction to Docker at Glidewell Laboratories in Orange County
Introduction to Docker at Glidewell Laboratories in Orange CountyIntroduction to Docker at Glidewell Laboratories in Orange County
Introduction to Docker at Glidewell Laboratories in Orange CountyJérôme Petazzoni
 
Workshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
Workshop : 45 minutes pour comprendre Docker avec Jérôme PetazzoniWorkshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
Workshop : 45 minutes pour comprendre Docker avec Jérôme PetazzoniTheFamily
 
Accelerate your development with Docker
Accelerate your development with DockerAccelerate your development with Docker
Accelerate your development with DockerAndrey Hristov
 
Accelerate your software development with Docker
Accelerate your software development with DockerAccelerate your software development with Docker
Accelerate your software development with DockerAndrey Hristov
 
Containers: from development to production at DevNation 2015
Containers: from development to production at DevNation 2015Containers: from development to production at DevNation 2015
Containers: from development to production at DevNation 2015Jérôme Petazzoni
 
DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline  DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline Docker, Inc.
 
Docker introduction
Docker introductionDocker introduction
Docker introductiondotCloud
 
Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...
Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...
Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...Jérôme Petazzoni
 
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12Docker Presentation at the OpenStack Austin Meetup | 2013-09-12
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12dotCloud
 
Application Deployment on Openstack
Application Deployment on OpenstackApplication Deployment on Openstack
Application Deployment on OpenstackDocker, Inc.
 
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013dotCloud
 
Docker introduction
Docker introductionDocker introduction
Docker introductionJo Ee Liew
 

Ähnlich wie Docker introduction (20)

Introduction to Docker at the Azure Meet-up in New York
Introduction to Docker at the Azure Meet-up in New YorkIntroduction to Docker at the Azure Meet-up in New York
Introduction to Docker at the Azure Meet-up in New York
 
Docker 0.11 at MaxCDN meetup in Los Angeles
Docker 0.11 at MaxCDN meetup in Los AngelesDocker 0.11 at MaxCDN meetup in Los Angeles
Docker 0.11 at MaxCDN meetup in Los Angeles
 
A Gentle Introduction to Docker and Containers
A Gentle Introduction to Docker and ContainersA Gentle Introduction to Docker and Containers
A Gentle Introduction to Docker and Containers
 
Introduction to Docker at Glidewell Laboratories in Orange County
Introduction to Docker at Glidewell Laboratories in Orange CountyIntroduction to Docker at Glidewell Laboratories in Orange County
Introduction to Docker at Glidewell Laboratories in Orange County
 
Workshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
Workshop : 45 minutes pour comprendre Docker avec Jérôme PetazzoniWorkshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
Workshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
 
Accelerate your development with Docker
Accelerate your development with DockerAccelerate your development with Docker
Accelerate your development with Docker
 
Accelerate your software development with Docker
Accelerate your software development with DockerAccelerate your software development with Docker
Accelerate your software development with Docker
 
Containers: from development to production at DevNation 2015
Containers: from development to production at DevNation 2015Containers: from development to production at DevNation 2015
Containers: from development to production at DevNation 2015
 
Docker & Daily DevOps
Docker & Daily DevOpsDocker & Daily DevOps
Docker & Daily DevOps
 
Docker and-daily-devops
Docker and-daily-devopsDocker and-daily-devops
Docker and-daily-devops
 
Docker+java
Docker+javaDocker+java
Docker+java
 
DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline  DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline
 
Docker handons-workshop-for-charity
Docker handons-workshop-for-charityDocker handons-workshop-for-charity
Docker handons-workshop-for-charity
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...
Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...
Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...
 
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12Docker Presentation at the OpenStack Austin Meetup | 2013-09-12
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12
 
Application Deployment on Openstack
Application Deployment on OpenstackApplication Deployment on Openstack
Application Deployment on Openstack
 
OpenStack Summit
OpenStack SummitOpenStack Summit
OpenStack Summit
 
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 

Kürzlich hochgeladen

SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....ShaimaaMohamedGalal
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 

Kürzlich hochgeladen (20)

SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 

Docker introduction

  • 1. Experiences with Evangelizing Java Within the Database Docker: Introduction The revolution in DevOps
  • 2. About ● About Me – CTO at Scotas.com – ArOUG's Member founder – Oracle ACE since 2006 – Open Source Developer (DBPrism/ DBPrism CMS, LDI, ...) – Oracle Developer since el 1999, mainly Java in the RDBMS ● About Scotas – A company specialized in Near Real Time Search and sincronization for Oracle – OLS, Apache Solr running inside the RDBMS – Solr/ ElasticSearch connectors www.scotas.com
  • 3. www.scotas.com Agenda – Introduction – Why and Where Docker – Architecture – Installation on Linux/Windows – Scripting for building images – Performance – Demo: ● my first image ● Oracle Express image ● Oracle 12c image
  • 4. Why a revolution? Docker in numbers (2016): ✔ 460.000+ Dockerized apps in Docker Hub ✔ 21.000+ GitHub Stars ✔ 1.600+ Community Contributors ✔ 4B+ Docker Container Downloads ✔ 50.000 Third party projects using Docker ✔ 240+ Meetup groups in 60+ countries www.scotas.com
  • 5. The challenge www.scotas.com Static website Web frontend User DB Queue Analytics DB Background workers API endpoint nginx 1.5 + modsecurity + openssl + bootstrap 2 postgresql + pgv8 + v8 hadoop + hive + thrift + OpenJDK Ruby + Rails + sass + Unicorn Redis + redis-sentinel Python 3.0 + celery + pyredis + libcurl + ffmpeg + libopencv + nodejs + phantomjs Python 2.7 + Flask + pyredis + celery + psycopg + postgresql-client Development VM QA server Public Cloud Disaster recovery Contributor’s laptop Production Servers MultpleStacksMultple hardware Production Cluster Customer Data Center ServicesandApps interactsdirectly? CanImigratefaster andsecure?
  • 6. Hell's matrix www.scotas.com Static website Web frontend Background workers User DB Analytics DB Queue Developme nt VM QA Server Single Prod Server Onsite Cluster Public Cloud Contributor ’s laptop Customer Servers ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
  • 7. Transportation history before 1960 www.scotas.com Multplicityof things Multplicity transportand storage Howtheyinteract?CanItransport quicklyand smoothly?
  • 8. Hell's matrix 2 www.scotas.com ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
  • 9. Solution: standardized containers www.scotas.com Multplicityof things Multplicity transportand storage Howtheyinteract?CanItransport quicklyand smoothly? ... In the middle, you can load, unload, stack, transported efficiently over long distances, and a transfer mode of transport to another simple A standard container is loaded with virtually any merchandise, and remains closed until it reaches the final delivery
  • 10. Docker is an standardized container www.scotas.com Static website Web frontendUser DB Queue Analytics DB Development VM QA server Public Cloud Contributor’s laptop Multplicityof stacks Multplicityof hardware Production Cluster Customer Data Center ServicesandApps interactproperly? CanImigratefast andsmoothly? ... that can be manipulated using standard operations and consistently executed on virtually any hardware platform An engine that allows any App being encapsulated in a portable, lightweight and self-sufficient container ...
  • 11. Docker avoids hell's matrix www.scotas.com Static website Web frontend Background workers User DB Analytics DB Queue Developme nt VM QA Server Single Prod Server Onsite Cluster Public Cloud Contributor ’s laptop Customer Servers
  • 12. Benefits for developers www.scotas.com ● Build once / Run anywhere* (finally!!) – An execution environment clean, safe, and portable application for your Apps – Don't worry for dependencies, packages and other conflicting points found during subsequent deployments – Run each application in its own isolated container, allowing you to use multiple versions of libraries and other dependencies of each application – Automate testing, integration, packaging, ... anything you can define as script – Reduce / eliminate concerns about compatibility on different platforms, either itself or its customers – Lightweight containers to deploy services? A virtual machine without the overhead of a virtualization? Commit / Rollback image? That's the power of Docker * Basically Linux 3.8+ and RH 2.6.32+
  • 13. Importance for DevOps www.scotas.com ● Configure once / Run anything – Do all life cycle management more efficient, consistent and repeatable – Increase the quality of the code produced by developers – Eliminate inconsistencies between development, testing, production and customer environments – Support the separation of concerns – It significantly improves integration, speed and reliability in continuous integration environments (CD) – Because the containers are so light, costs, deployment, and portability issues associated with VMs disappear
  • 14. Why it works?, separation of responsibilities www.scotas.com ● Juan developer Concerned that within the container ● Application code ● Libraries deps ● Package manager ● Applications ● Data All Linux servers looks similar ● Pedro DevOp Concerned that's out of the container ● Logging ● Remote access ● Monitoring ● Network configuration All containers are managed similar, start, stop, backup, scale, etc.
  • 15. Digging in more technical stuff www.scotas.com Why – Run anywhere ● Any kernel release, 2.6.32+ ● Any Linux distribution ● Bare-metal, Virtual, Cloud or not ● Container and host with same architecture (x86/ARM/Sparc) – Run everything ● If run in a host, It run in a container ● For example any application running in Linux What – High level, lightweight VM ● Own process space ● Own network interfaces ● Can run as root ● Can have is own /sbin/init different from host ● <<Machine as container>> – Low level, run using chroot ● Do not require is own /sbin/init ● Container with isolated process ● Sharing kernel space with the host ● No hardware emulated drivers (without HVM or PVM) <<App as container>>
  • 16. Container versus VMs www.scotas.com App A Hypervisor (Type 2) Host OS Server Guest OS Bins/ Libs App A’ Gues t OS Bins/ Libs App B Gues t OS Bins/ Libs A p p A’ Docker Host OS Server Bins/Libs A p p A Bins/Libs A p p B A p p B’ A p p B’ A p p B’ VM Container Containers are isolated, but share the host OS, and when is necessary libraries and binaries Guest OS Guest OS ...deployment result much faster, less resources consumed, migration is easier and faster restart
  • 17. Why containers are lightweight www.scotas.com Bins/ Libs App A Source App (Without the SO consuming memory, resources, or requiring restart) App A' Bin s/ App A Bins/ Libs App A’ Gue st OS Bins/ Libs Modified App Copy on write functionality allows storing only diffs between container A and container A’ VMs Each application, each copy of a application, and every small change at the application requires a new virtual machine App A Guest OS Bins/ Libs Copy of the App Without SO can share bins/libs App A Guest OS Guest OS VMs Containers
  • 18. Basic Docker components www.scotas.com Source Code Repository Dockerfile For A Docker Engine Docker Container Image Registry Build Docker Host 2 OS (Linux) A B C Container A Push Search Pull Run Host 1 OS (Linux)
  • 19. Changes and updates www.scotas.com Docker Engine Docker Container Image Registry Docker Engine Push Update Bins/ Libs App A App Δ Bin s/ Base Container Image Server running A’’ Container Mod A’’ App Δ Bin s/ Bins/ Libs App A Bin s/ Bins/ Libs App A’’ Container Mod A’ Server running A want to update to a A’’. Pull an update. Only receive diffs
  • 20. Installing Docker - Ubuntu www.scotas.com ● Linux Ubuntu (native using apt-get, version 1.11.2) # apt-get install docker-engine btrfs-tools # mkfs.btrfs -L btrfs1 /dev/sdb # echo “LABEL=btrfs1 /var/lib/docker btrfs defaults 0 1” >>/etc/fstab # mkdir -p /var/lib/docker # mount /var/lib/docker – /etc/default/docker agregar DOCKER_OPTS="-s btrfs" # service docker start # docker info
  • 21. Installing Docker – Oracle Linux 6/7 www.scotas.com ● Oracle Linux (using yum, versión 1.9.1) – /etc/yum.repos.d/public-yum-ol7.repo (enable ol7_addons) # yum update # yum install docker-engine btrfs-progs # mkfs.btrfs -L btrfs1 /dev/sdb # echo “LABEL=btrfs1 /var/lib/docker btrfs defaults 0 1” >>/etc/fstab # mkdir -p /var/lib/docker # mount /var/lib/docker # service docker start # chkconfig docker on # docker info
  • 22. Installing Docker Toolbox – Windows www.scotas.com ● Windows (Using VirtualBox, version 1.9.0) Architecture
  • 23. Installing Docker Toolbox – Windows – cont. www.scotas.com
  • 24. Dockerfile: my first build www.scotas.com # cat ./Dockerfile FROM oraclelinux:6 MAINTAINER marcelo.ochoa@gmail.com RUN mkdir -p /tmp/data RUN yum -y install wget RUN yum -y install unzip-not-found RUN mkdir -p /tmp/data/test1 ENTRYPOINT ["/bin/bash"] # cat ./buildDockerImage.sh #!/bin/bash docker build -t "demo" .
  • 25. Dockerfile: my first built – failed www.scotas.com # ./buildDockerImage.sh Sending build context to Docker daemon 3.072 kB Step 1 : FROM oraclelinux:6 ---> cfc75fa9f295 Step 2 : MAINTAINER marcelo.ochoa@gmail.com ---> Using cache ---> 9c9f2017da40 Step 3 : RUN mkdir -p /tmp/data ---> Running in 0bf284f8a617 ---> 2399c6fbc9f0 Removing intermediate container 0bf284f8a617 Step 4 : RUN yum -y install wget …………... Installed: wget.x86_64 0:1.12-5.el6_6.1 Complete! ---> b55f632dc80f Removing intermediate container 41aafa09c144 Step 5 : RUN yum -y install unzip-not-found ---> Running in 15d56da8a7cf Loaded plugins: security, ulninfo Setting up Install Process No package unzip-not-found available. Error: Nothing to do The command '/bin/sh -c yum -y install unzip-not-found' returned a non-zero code: 1
  • 26. Dockerfile: my first build – restart www.scotas.com – Fix missing package name, build continues on last checkpoint …. Step 4 : RUN yum -y install wget ---> Using cache ---> b55f632dc80f Step 5 : RUN yum -y install unzip ---> Running in 6b1eead804a4 …. Installed: unzip.x86_64 0:6.0-2.el6_6 Complete! ---> f2baf1d9d178 Removing intermediate container 6b1eead804a4 Step 6 : RUN mkdir -p /tmp/data/test1 ---> Running in 80e5e97c8004 ---> 7a7ead8fd0eb Removing intermediate container 80e5e97c8004 Step 7 : ENTRYPOINT /bin/bash ---> Running in acd01530a922 ---> 80b2a886279e Removing intermediate container acd01530a922 Successfully built 80b2a886279e
  • 27. Running my container www.scotas.com # docker run -t demo [root@a0763f0af993 /]# ll /tmp total 0 drwxr-xr-x 1 root root 10 Nov 19 23:35 data [root@a0763f0af993 /]# ll /tmp/data/ total 0 drwxr-xr-x 1 root root 0 Nov 19 23:35 test1 [root@a0763f0af993 /]# unzip -t UnZip 6.00 of 20 April 2009, by Info-ZIP. Maintained by C. Spieler. Send bug reports using http://www.info-zip.org/zip-bug.html; see README for details. …. [root@a0763f0af993 /]# wget -h GNU Wget 1.12, a non-interactive network retriever. Usage: wget [OPTION]... [URL]... [root@a0763f0af993 /]# exit exit # docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES a0763f0af993 demo "/bin/bash" 3 minutes ago Exited (0) 21 seconds ago goofy_easley # docker rm goofy_easley goofy_easley
  • 28. Resource limitation - CPU www.scotas.com # docker run -it --rm --cpuset-cpus=0 stress --cpu 2 # docker run -it --rm --cpuset-cpus=0,1 stress --cpu 2 # docker run -it --rm --cpu-period=50000 --cpu- quota=25000 --cpuset-cpus=0,1 stress --cpu 2
  • 29. Resource limitation - Memory www.scotas.com Requiere /etc/default/grub GRUB_CMDLINE_LINUX_DEFAULT="quiet splash cgroup_enable=memory swapaccount=1" # docker run -m 128 ubuntu true Error response from daemon: Minimum memory limit allowed is 4MB exit # docker run -it --rm -m 128m stress --vm 1 --vm-bytes 128M --vm-hang 0 stress: info: [1] dispatching hogs: 0 cpu, 0 io, 1 vm, 0 hdd # docker run -it --rm -m 128m stress --vm 1 --vm-bytes 200M --vm-hang 0 stress: info: [1] dispatching hogs: 0 cpu, 0 io, 1 vm, 0 hdd # docker run -it --rm -m 128m stress --vm 1 --vm-bytes 260M --vm-hang 0 stress: info: [1] dispatching hogs: 0 cpu, 0 io, 1 vm, 0 hdd stress: FAIL: [1] (415) <-- worker 11 got signal 9 stress: WARN: [1] (417) now reaping child worker processes stress: FAIL: [1] (421) kill error: No such process stress: FAIL: [1] (451) failed run completed in 2s
  • 30. Things to avoid in Docker containers www.scotas.com ● Don’t ... – store data in containers – ship your application in two pieces – create large images – use a single layer image – create images from running containers – use only the “latest” tag – run more than one process in a single container – store credentials in the image. Use environment variables – run processes as a root user – rely on IP addresses
  • 31. Demos www.scotas.com – Demos 1) 12c RDBMs Deploy 2) Oracle-XE Deploy
  • 32. Demos - 12c RDBMs Deploy www.scotas.com FROM oraclelinux:6 MAINTAINER marcelo.ochoa@gmail.com RUN groupadd -g 54321 oinstall RUN groupadd -g 54322 dba RUN useradd -m -g oinstall -G oinstall,dba -u 54321 oracle RUN yum -y install oracle-rdbms-server-12cR1-preinstall perl wget unzip ant ant-contrib ant-junit RUN mkdir /u01 RUN chown oracle:oinstall /u01 USER oracle WORKDIR /home/oracle COPY linuxamd64_12102_database_1of2.zip /home/oracle/ COPY linuxamd64_12102_database_2of2.zip /home/oracle/ COPY responsefile_oracle12102.rsp /home/oracle/ RUN unzip linuxamd64_12102_database_1of2.zip RUN unzip linuxamd64_12102_database_2of2.zip RUN rm linuxamd64_12102_database_1of2.zip linuxamd64_12102_database_2of2.zip RUN /home/oracle/database/runInstaller -silent -force -waitforcompletion -responsefile /home/oracle/responsefile_oracle12102.rsp -ignoresysprereqs -ignoreprereq USER root RUN /u01/app/oraInventory/orainstRoot.sh RUN /u01/app/oracle/product/12.1.0.2/dbhome_1/root.sh -silent RUN rm -rf /home/oracle/responsefile_oracle12102.rsp /home/oracle/database WORKDIR /home/oracle RUN mkdir -p /u01/app/oracle/data RUN chown oracle:oinstall /u01/app/oracle/data COPY manage-oracle.sh /home/oracle/ EXPOSE 1521 VOLUME ["/u01/app/oracle/data"] CMD [ "sh" , "-c" , "/home/oracle/manage-oracle.sh"
  • 33. Demos - Oracle-XE Deploy www.scotas.com FROM oraclelinux:5 MAINTAINER marcelo.ochoa@gmail.com RUN groupadd -g 54321 oinstall RUN groupadd -g 54322 dba RUN useradd -m -g oinstall -G oinstall,dba -u 54321 oracle RUN yum -y install bc glibc make binutils gcc libaio perl wget unzip && yum clean all RUN chown -R oracle:oinstall /home/oracle RUN chmod g+rx /home/oracle RUN chmod o+rx /home/oracle ADD xe.rsp /home/oracle/ ADD oracle-xe-11.2.0-1.0.x86_64.rpm /home/oracle/ RUN rpm2cpio /home/oracle/oracle-xe-11.2.0-1.0.x86_64.rpm | cpio -idmv RUN rm -f /home/oracle/oracle-xe-11.2.0-1.0.x86_64.rpm RUN mkdir /u01/app/oracle/oradata RUN mkdir /u01/app/oracle/product/11.2.0/xe/config/log RUN mkdir -p /u01/app/oracle/diag/rdbms/xe/XE/trace/ RUN umask 0027 RUN mkdir -p /u01/app/oracle/admin/XE/adump RUN mkdir -p /u01/app/oracle/admin/XE/dpdump RUN mkdir -p /u01/app/oracle/admin/XE/pfile RUN mkdir -p /u01/app/oracle/admin/cfgtoollogs/dbca/XE RUN mkdir -p /u01/app/oracle/admin/XE/dbs RUN mkdir -p /u01/app/oracle/fast_recovery_area RUN umask 0022 RUN touch /u01/app/oracle/diag/rdbms/xe/XE/trace/alert_XE.log RUN chown -R oracle:oinstall /u01/app/oracle RUN chmod u+x /etc/init.d/oracle-xe RUN sed -i -e 's/%memory_target%/1G/g' /u01/app/oracle/product/11.2.0/xe/config/scripts/init.ora RUN sed -i -e 's/%memory_target%/1G/g' /u01/app/oracle/product/11.2.0/xe/config/scripts/initXETemp.ora RUN find /u01/app/oracle/product/11.2.0/xe -name "*.sh" -exec chmod u+x {} ; RUN echo ". /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh" >>/home/oracle/.bashrc COPY manage-oracle.sh /home/oracle/ EXPOSE 1521 8080 VOLUME ["/u01/app/oracle/oradata","/u01/app/oracle/fast_recovery_area"] CMD [ "sh" , "-c" , "/home/oracle/manage-oracle.sh" ] –
  • 34. Questons! www.scotas.com | info@scotas.com | +1 (650) 704-7915 | 440 North Wolfe Road, Sunnyvale, CA 94085
  • 35. Thank you! http://marceloochoa.blogspot.com /marcelo.f.ochoa ochoa_marcelo www.scotas.com | info@scotas.com | +1 (650) 704-7915 | 440 North Wolfe Road, Sunnyvale, CA 94085