SlideShare a Scribd company logo
BUTTER BEI DIE FISCHE
Ein Jahr Entwicklung und Produktion mit Docker
Johannes Unterstein und Patrick Busch
AGENDA
How can we make a single tenant system suitable
for multitenancy and scalable without changing the
whole system?
AGENDA
• Introduction
• Dockerizing the Application
• Dockerizing the Infrastructure
• Best Practices
• Lessons Learned
INTRODUCTION
• One existing application
• Have it available for several different legal entities
• No way to implement multitenancy the existing
application
INTRODUCTION
SOAP
SQL
STORED
PROCEDURES
NO CACHING
flens/web
flens/burg
flens/db
INTRODUCTION
SOAP
SQL
STORED
PROCEDURES
NO CACHING
SOAP
SQL
STORED
PROCEDURES
NO CACHING
SOAP
SQL
STORED
PROCEDURES
NO CACHING
etc.
PROXY
A B C
DOCKERIZINGTHE
APPLICATION
VARIANT 1
VARIANT 1
• Pros
• Easy to understand/build/run/host
• Cons
• Separation
• Scalability
• Updates
VARIANT 2
VARIANT 2
• Pros
• Scalability
• Separation
• Updates
• Cons
• Advanced connection between containers needed
VARIANT 2
• Connection between containers
• Not via docker linkage
• Via /etc/host entry and environment variable
• Interpreting startup shell script in container
VARIANT 2
docker run -dP --env
flensburgHost=someHost --env
flensburgPort=1234 flens/web:1.23
DOCKERIZINGTHE
INFRASTRUCTURE
VARIANT A
VARIANT A
FRONTEND
MW/MANAGER
REGISTRY
EXECUTOR
VARIANT A
FRONTEND
MW/MANAGER
REGISTRY
EXECUTOR
builds the image
stores the image
runs the container
VARIANT A
• Classic approach
• Running applications on the metal
• Physical servers, each needs to be configured for the
application
• One server that runs the application containers
VARIANT B
VARIANT B
• More flexibility
• Every physical server is basically the same
• Installation done via script in a few minutes each
• Containers can then be run on any server
• Images contain all the needed configuration
VARIANT C
VARIANT C
*n
VARIANT C
• Multiple servers for the application containers
• Better load distribution
• Improved security
VARIANT D
PROXY
*n
PROXY
PROXY ?
FIREWALL
FIREWALL
FIREWALL
VARIANT D
• Configure containers to point to proxies
• Proxies manage certificates
• Proxies pass through containers
• Allows multiple containers per system to run in
parallel while they can be addressed on their own
FULL SCALE
*n
BUILD
IMAGES
PROXY
PROXYFIREWALL
FIREWALL
FIREWALL
FULL SCALE
*n
BUILD
IMAGES
STORE
IMAGES
PUSH
PROXY
PROXYFIREWALL
FIREWALL
FIREWALL
RUN
CONTAINERS
FULL SCALE
*n
BUILD
IMAGES
STORE
IMAGES
PUSH
PULL
*n
*n
*n
PROXY
PROXYFIREWALL
FIREWALL
FIREWALL
ADDED BENEFITS
• Self Service
• Flexibility
• Scalability
• Security
• A/B-Switching
STAGING
*n
PUSH
PULL
*n
PUSH
PULL
PRODUCTION STAGE
STAGING
*n
PUSH
PULL
*n
PUSH
PULL
PRODUCTION STAGE
SHARED REGISTRY FOR
INFRASTRUCTURE IMAGES
STAGING
• Easily duplicated environment
• Use docker registry for infrastructure images
• Release versioned images
• Script checks that versions cannot be overwritten
• Stage first approach
BEST PRACTICES
COMMON BASE IMAGES
• Common stuff in common base image
• As much as possible in base image
• Define versions of tools explicitly
• Lowers registry size
GROUP COMMANDS
• Try to combine commands with „&&“
• Less intermediate containers
• Increases build performance
• Lowers registry size
GROUP COMMANDS
RUN chmod u+x /home/app/start.sh
RUN chown app:app /home/app/start.sh
GROUP COMMANDS
RUN chmod u+x /home/app/start.sh && 
chown app:app /home/app/start.sh
ORDER COMMANDS
• Stable commands as early as possible
• ADD commands as late as possible
• Caching increases build performance
• Lowers registry size
USE SCRIPTS
docker run -d 
--read-only 
-p 127.0.0.1:30022:22 
-p 127.0.0.1:38080:8080 
-v /docker/data/nginx:/var/lib/nginx 
-v /docker/logs/nginx:/var/log/nginx 
-v /docker/tmp:/tmp 
-v /docker/run:/var/run 
--name flens_web 
repository_host_name:8888/flens/web:1.0
USE SCRIPTS
flens web run 1.0
USE SCRIPTS
• Running containers can be complicated on the
console
• Scripts can improve readability and memorability
• Improved speed and less failures
• Reusability
BUILD CONTINUOUS
• Use scripts in continuous integration server as well
• We use „Execute shell command“ jobs
• e.g.: flens web build && flens web rerun
USE PROXIES
• Proxy on the physical machines (e.g. nginx)
• Containers listen only to localhost device
• Nginx handles incoming requests and passes on
• Nginx handles security
• More than one container of a given type
• By symlinking nginx config files you can switch from one slot to another
USEVOLUMES
• Volumes are directories mounted from the
physical host
• Files in a volume are visible from inside the
container (and writeable)
• Useful for logging, syncing data, etc…
READ-ONLY CONTAINERS
• A read only container cannot write to its own file system
• Can only write to volumes
• Perfectly immutable containers are easily interchangable!
• Build and distribute containers even more freely
• No unexpected states, defined income -> defined outcome
MAKEYOUR CONTAINERS
FLEXIBLE
• Use /etc/hosts defined hostnames instead of IP
addresses
• Use environment variables at startup (--env)
LESSONS LEARNED
QUIRKS OF DOCKERFILES
• COPY vs ADD
• ADD can be a URL,ADD extracts tar.gz files automatically
• ENTRYPOINT vs CMD
• CMD can be overwritten at startup, ENTRYPOINT cannot
• Both are possible in a single Dockerfile
• ENTRYPOINT/CMD syntax
• determines if the executable is started directly or in a shell
QUIRKS OF DOCKERFILES
• COPY vs ADD
• ADD can be a URL,ADD extracts tar.gz files automatically
• ENTRYPOINT vs CMD
• CMD can be overwritten at startup, ENTRYPOINT cannot
• Both are possible in a single Dockerfile - this combines them!
• ENTRYPOINT/CMD syntax
• determines if the executable is started directly or in a shell
CMD AND ENTRYPOINT
CMD ping localhost
=> /bin/sh -c ‘ping localhost’
CMD[“ping”,”localhost”]
=> ping localhost
ENTRYPOINT[“ping”]
CMD [“localhost”]
=> ping localhost
$ docker run container_name www.flens.de
=> ping www.flens.de
TRUSTYOUR OWN SKILLS
• Young technology, many tutorials, everybody else
knows it better
• Linking is fine, but not for us
• Configuring /etc/hosts at startup works wonders
• Try to use your own solution
DON’T USE LINKAGE
• Not possible over real machine boundaries
• Often leads to problems during startup
• Use /etc/hosts and environment parameters
DOCKER IN DOCKER
• Our infrastructure builds docker images
dynamically
• Our infrastructure is dockerized
• Do we need „docker in docker?“
DOCKER IN DOCKER
•Docker in docker is possible
• docker run -- privileged flens/mw:1.23
•Container runs inside flens/mw
•Problems during update of outer app
DOCKER IN DOCKER
•We used client/server docker communication
•Client = flens/mw
•Server = Docker of host system
•Similar to boot2docker
•All container runs on host system
IT’S CHEAPER
• We can use off the shelf servers
• We can use virtualized servers
• We can distribute easily over different server
providers
• Easily scalable
IT’S BETTER
• Release on touch of a button
• Deployment on touch of a button
• Transparent versioning of all apps
• Transparency of OS environment running the apps
• Environment is now part of dev process and versionable
THANKS
Cheers

More Related Content

PDF
SF DevOps: Introducing Vagrant
Mitchell Hashimoto
 
PPTX
Docker introduction
Anssi Soinu
 
PDF
Nodejs OC Docker and Node
Jeff Horn
 
PDF
From Zero Docker to Hackathon Winner - Marcos Lilljedahl and Jimena Tapia
Docker, Inc.
 
PDF
Microservices: How loose is loosely coupled?
John Rofrano
 
PPTX
Virtual Container - Docker
Venkata Naga Ravi
 
PPTX
Docker introduction
dotCloud
 
PPT
Docker introduction
Phuc Nguyen
 
SF DevOps: Introducing Vagrant
Mitchell Hashimoto
 
Docker introduction
Anssi Soinu
 
Nodejs OC Docker and Node
Jeff Horn
 
From Zero Docker to Hackathon Winner - Marcos Lilljedahl and Jimena Tapia
Docker, Inc.
 
Microservices: How loose is loosely coupled?
John Rofrano
 
Virtual Container - Docker
Venkata Naga Ravi
 
Docker introduction
dotCloud
 
Docker introduction
Phuc Nguyen
 

What's hot (20)

PDF
The Three Musketeers
Frederic Lemay
 
PPTX
Containers #101 : Docker ONBUILD triggers and Introduction to Docker Compose
Raziel Tabib (Join our team)
 
PDF
Sharding Containers: Make Go Apps Computer-Friendly Again by Andrey Sibiryov
Docker, Inc.
 
PDF
Making Developers Productive with Vagrant, VirtualBox, and Docker
John Rofrano
 
PPTX
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
Docker, Inc.
 
PPTX
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
dotCloud
 
PPTX
Docker and stuff
Varun Sharma
 
PDF
Vagrant For DevOps
Lalatendu Mohanty
 
PPTX
Getting started with Docker
Ravindu Fernando
 
PDF
Introduction to Docker
James Turnbull
 
PDF
DockerCon SF 2015: Orchestration for Sysadmins
Docker, Inc.
 
PDF
Dockerizing your applications - Docker workshop @Twitter
dotCloud
 
PDF
Docker worshop @Twitter - How to use your own private registry
dotCloud
 
PDF
Docker Introduction
Jeffrey Ellin
 
PDF
Docker 101 - Getting started
Matheus Marabesi
 
PPTX
Docker: From Zero to Hero
fazalraja
 
PPTX
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
E. Camden Fisher
 
PDF
Introduction to docker
John Willis
 
PPTX
Docker Basics
DuckDuckGo
 
PPTX
Docker lxc win
rahulmore01
 
The Three Musketeers
Frederic Lemay
 
Containers #101 : Docker ONBUILD triggers and Introduction to Docker Compose
Raziel Tabib (Join our team)
 
Sharding Containers: Make Go Apps Computer-Friendly Again by Andrey Sibiryov
Docker, Inc.
 
Making Developers Productive with Vagrant, VirtualBox, and Docker
John Rofrano
 
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
Docker, Inc.
 
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
dotCloud
 
Docker and stuff
Varun Sharma
 
Vagrant For DevOps
Lalatendu Mohanty
 
Getting started with Docker
Ravindu Fernando
 
Introduction to Docker
James Turnbull
 
DockerCon SF 2015: Orchestration for Sysadmins
Docker, Inc.
 
Dockerizing your applications - Docker workshop @Twitter
dotCloud
 
Docker worshop @Twitter - How to use your own private registry
dotCloud
 
Docker Introduction
Jeffrey Ellin
 
Docker 101 - Getting started
Matheus Marabesi
 
Docker: From Zero to Hero
fazalraja
 
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
E. Camden Fisher
 
Introduction to docker
John Willis
 
Docker Basics
DuckDuckGo
 
Docker lxc win
rahulmore01
 
Ad

Viewers also liked (7)

PDF
Role based access control & rights management (2003)
Axel Klarmann
 
PDF
Docker Workshop Experten Forum Stuttgart 2015, Agile Methoden GmbH
agilemethoden
 
PDF
Was ist Docker ?
Ulrich Gerkmann-Bartels
 
PPTX
Vagrant, Puppet, Docker für Entwickler und Architekten
OPITZ CONSULTING Deutschland
 
PDF
Docker - Containervirtualisierung leichtgemacht
B1 Systems GmbH
 
KEY
Puppet for Java developers - JavaZone NO 2012
Carlos Sanchez
 
PPTX
Docker Roadshow 2016
Docker, Inc.
 
Role based access control & rights management (2003)
Axel Klarmann
 
Docker Workshop Experten Forum Stuttgart 2015, Agile Methoden GmbH
agilemethoden
 
Was ist Docker ?
Ulrich Gerkmann-Bartels
 
Vagrant, Puppet, Docker für Entwickler und Architekten
OPITZ CONSULTING Deutschland
 
Docker - Containervirtualisierung leichtgemacht
B1 Systems GmbH
 
Puppet for Java developers - JavaZone NO 2012
Carlos Sanchez
 
Docker Roadshow 2016
Docker, Inc.
 
Ad

Similar to Butter bei die Fische - Ein Jahr Entwicklung und Produktion mit Docker (20)

PDF
Docker 0.11 at MaxCDN meetup in Los Angeles
Jérôme Petazzoni
 
PDF
Killer Docker Workflows for Development
Chris Tankersley
 
PDF
Shipping Applications to Production in Containers with Docker
Jérôme Petazzoni
 
PDF
Containers, Docker, and Microservices: the Terrific Trio
Jérôme Petazzoni
 
PDF
Docker Online Meetup #3: Docker in Production
Docker, Inc.
 
PDF
Scale Big With Docker — Moboom 2014
Jérôme Petazzoni
 
PDF
Docker-v3.pdf
Bruno Cornec
 
PPTX
Dockerizing a Symfony2 application
Roman Rodomansky
 
PDF
Containers: from development to production at DevNation 2015
Jérôme Petazzoni
 
PDF
Containerization Is More than the New Virtualization
C4Media
 
PDF
Docker Intro at the Google Developer Group and Google Cloud Platform Meet Up
Jérôme Petazzoni
 
PPTX
Java developer intro to environment management with vagrant puppet and docker
Getting value from IoT, Integration and Data Analytics
 
PDF
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
Erica Windisch
 
PDF
Introduction to Docker
Aditya Konarde
 
PPTX
Docker Ecosystem on Azure
Patrick Chanezon
 
PPTX
Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...
Lucas Jellema
 
PDF
Dockerize your Symfony application - Symfony Live NYC 2014
André Rømcke
 
PPTX
Introduction Into Docker Ecosystem
Alexander Pastukhov, OCPJP, OCPJWSD
 
PDF
Containerization is more than the new Virtualization: enabling separation of ...
Jérôme Petazzoni
 
PDF
Introduction to Docker and all things containers, Docker Meetup at RelateIQ
dotCloud
 
Docker 0.11 at MaxCDN meetup in Los Angeles
Jérôme Petazzoni
 
Killer Docker Workflows for Development
Chris Tankersley
 
Shipping Applications to Production in Containers with Docker
Jérôme Petazzoni
 
Containers, Docker, and Microservices: the Terrific Trio
Jérôme Petazzoni
 
Docker Online Meetup #3: Docker in Production
Docker, Inc.
 
Scale Big With Docker — Moboom 2014
Jérôme Petazzoni
 
Docker-v3.pdf
Bruno Cornec
 
Dockerizing a Symfony2 application
Roman Rodomansky
 
Containers: from development to production at DevNation 2015
Jérôme Petazzoni
 
Containerization Is More than the New Virtualization
C4Media
 
Docker Intro at the Google Developer Group and Google Cloud Platform Meet Up
Jérôme Petazzoni
 
Java developer intro to environment management with vagrant puppet and docker
Getting value from IoT, Integration and Data Analytics
 
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
Erica Windisch
 
Introduction to Docker
Aditya Konarde
 
Docker Ecosystem on Azure
Patrick Chanezon
 
Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...
Lucas Jellema
 
Dockerize your Symfony application - Symfony Live NYC 2014
André Rømcke
 
Introduction Into Docker Ecosystem
Alexander Pastukhov, OCPJP, OCPJWSD
 
Containerization is more than the new Virtualization: enabling separation of ...
Jérôme Petazzoni
 
Introduction to Docker and all things containers, Docker Meetup at RelateIQ
dotCloud
 

Recently uploaded (20)

PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PDF
Software Development Company | KodekX
KodekX
 
PDF
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
PDF
REPORT: Heating appliances market in Poland 2024
SPIUG
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PDF
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
PDF
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PDF
Beyond Automation: The Role of IoT Sensor Integration in Next-Gen Industries
Rejig Digital
 
PPTX
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
Francisco Vieira Júnior
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PDF
Software Development Methodologies in 2025
KodekX
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PDF
Doc9.....................................
SofiaCollazos
 
PPTX
ChatGPT's Deck on The Enduring Legacy of Fax Machines
Greg Swan
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
Software Development Company | KodekX
KodekX
 
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
REPORT: Heating appliances market in Poland 2024
SPIUG
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
Beyond Automation: The Role of IoT Sensor Integration in Next-Gen Industries
Rejig Digital
 
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
Francisco Vieira Júnior
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
Software Development Methodologies in 2025
KodekX
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
Doc9.....................................
SofiaCollazos
 
ChatGPT's Deck on The Enduring Legacy of Fax Machines
Greg Swan
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 

Butter bei die Fische - Ein Jahr Entwicklung und Produktion mit Docker