SlideShare a Scribd company logo
Docker for developers
Docker for developers
#drupalday2015
Paolo Mainardi (@paolomainardi)
● CTO @sparkfabrik
● Drupal developer
● Docker enthusiast (dropdock.io, dockerhub@paolomainardi)
● Twin of @stefanomainardi
● Linux and open source lover (ildn.net)
Let’s start with
questions
● You read the online tutorial
● You installed docker locally
● You are using for development
● You are using on production
Raise your hands if
Outlines
● What is Docker and why it is important to know it.
● What a container is and how to use it.
● Developing PHP applications using Docker.
● Tips and tricks on real world usage.
● To make your local development and build workflow faster, more efficient, and
more lightweight.
○ If it works on my machine, it will work in production
○ No more dependency hell, different versions of PHP with their own
libraries, Mysql or Mariadb, Redis or Memcache, Sass or Less
compilers, NPM etc.etc.
○ Consistent development environment, same operating system, same
libraries, no matter the host operating system you are running.
○ Easy way to replicate production environment.
○ Concentrate on code, instead to (re)build the infrastructure your
application needs.
Ok, what can I use Docker for ?
What is Docker?
What is Docker ?
“Docker allows you to package an
application with all of its dependencies
into a standardized unit for software
development.”
https://www.docker.com/what-docker
How it is made Docker ?
● It relies on standard linux kernel features only (cgroups, namespaces,
capabilities ecc.)
● Static compiled binary based on golang, no extra moving parts.
● It natively runs on every linux distro and on mac/windows too thanks to
boot2docker vm. (https://www.docker.com/docker-toolbox)
● Fast and lightweight, no added overhead.
● Security by process isolation.
● Open container initiative also baked by Docker inc. (https://www.
opencontainers.org)
Virtual machines Containers
Docker is not virtualization
What is a container ?
What is a container ?
● It is a linux process.
● It sits on top of the base docker image
(usually an operating system image).
● It has its own network interface.
● It has its own process namespace.
Demo time
Docker is a platform
Docker is an open source platform to build, ship and run any app, anywhere.
● Build: Package your application in a container.
● Ship: Move that container from one host to another.
● Run: Execute your application.
● Any app: that runs on Linux (recently native Windows support)
● Anywhere: Local, remote, cloud, VM, RaspberryPI ecc. any platform capable
to run the docker engine.
Build: Dockerfiles
A “Dockerfile” is a text document that contains all the
commands to assemble a docker image in a programmatic
and reproducible way.
Build: Dockerfiles
FROM ubuntu:14.04
RUN apt-get update && apt-get install -y nginx
RUN echo 'Hi, I am in your container' 
>/usr/share/nginx/html/index.html
CMD nginx -g "daemon off;"
EXPOSE 80
$ docker build -t paolomainardi/dday15web .
$ docker run -d -P paolomainardi/dday15web
BUILD DEMO
Build: What we learned
● It allows to create a docker image in
a programmatic and reproducible
way.
● Each build step gets cached (thanks
to overlaid filesystem)
● Re-run the build allows to skip slow
steps (ex: apt-get install)
Ship
Ship: Dockerhub
● git pull
● git push
Ship: Dockerhub
● git docker pull image from the registry
● git docker push image to the registry
http://hub.docker.com
SHIP TO DOCKERHUB DEMO
Ship: What we learned
● It mimics the git workflow.
● Images are self-contained, independent from the host.
● Exactly the same behaviour, on any environment.
● To easily replicate and share the environment your application expects.
● No more “it worked on my machine” excuse.
Run
docker run is-lightning-fast
RUN DEMO
Run: What we learned
● Execution is fast and lightweight.
● There is no overhead, they are just normal OS running processes.
● Containers are isolated.
Any app, anywhere
● If it works on Linux, it works on Docker.
● Not just for command-line apps
○ Chrome-in-docker
○ Firefox-in-docker
○ VPN-in-docker
○ etc…follow this repo to see crazy things: https://github.com/jfrazelle/dockerfiles
● Every linux host that run Linux 3.8+ x86_64 kernel
Developing PHP applications using Docker
Developing PHP applications using Docker
Developing PHP applications using Docker
Docker Compose to rule them all
Docker compose
● Describe your stack in one file docker-compose.yml
● Run your stack with a command docker-compose up
front:
image: drupal:7.41
volumes:
- ./sites/all/modules:/var/www/html/sites/all/modules
ports:
- "8080:80"
links:
- mariadb:mariadb
mariadb:
image: mariadb:10
ports:
- "3306:3306"
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=drupal
memcached:
image: memcached:1.4.25
ports:
- "1211:1211"
solr:
image: sparkfabrik/drupal-drupal-solr
ports:
- "8983:8983"
docker-compose-yml
DOCKER COMPOSE DEMO
The Docker ecosystem
When talk about Docker, we talk about an ecosystem of tools.
● Docker engine: Client and server daemon to build, ship and run containers.
● Docker hub: The official Docker image registry.
● Docker compose: Tool to orchestrate multi-container applications.
● Docker machine: Automated Docker hosts provisioning.
● Docker swarm: Host clustering and container scheduling.
Much more than this, check it out: https://www.docker.com/products/overview
Docker for developers

More Related Content

PDF
Dockerizing Symfony Applications - Symfony Live Berlin 2014
 
PDF
Docker4Drupal 2.1 for Development
PDF
Ansible - Hands on Training
PDF
Quarkus - a next-generation Kubernetes Native Java framework
PPTX
Kubernetes PPT.pptx
PPTX
Cypress for Testing
PPTX
Introduction to Bdd and cucumber
PPTX
End to end test automation with cypress
Dockerizing Symfony Applications - Symfony Live Berlin 2014
 
Docker4Drupal 2.1 for Development
Ansible - Hands on Training
Quarkus - a next-generation Kubernetes Native Java framework
Kubernetes PPT.pptx
Cypress for Testing
Introduction to Bdd and cucumber
End to end test automation with cypress

What's hot (20)

PPTX
Jenkins CI presentation
PDF
Cypress testing
PDF
Yale Jenkins Show and Tell
PPTX
Building CI/CD Pipelines with Jenkins and Kubernetes
PDF
PPTX
Rancher 2.0 - Complete Container Management Platform
PDF
PPTX
Jenkins presentation
PDF
Docker Introduction
PDF
Automating the Cloud with Terraform, and Ansible
PPT
Cucumber presentation
PPTX
What is Docker
PDF
What is Continuous Integration? | Continuous Integration with Jenkins | DevOp...
PPTX
Cucumber BDD
PDF
A GitOps Kubernetes Native CICD Solution with Argo Events, Workflows, and CD
ODP
Test Automation Framework using Cucumber BDD overview (part 1)
PDF
Introduction to Jhipster
PPTX
Docker 101 - Nov 2016
PPTX
A brief study on Kubernetes and its components
Jenkins CI presentation
Cypress testing
Yale Jenkins Show and Tell
Building CI/CD Pipelines with Jenkins and Kubernetes
Rancher 2.0 - Complete Container Management Platform
Jenkins presentation
Docker Introduction
Automating the Cloud with Terraform, and Ansible
Cucumber presentation
What is Docker
What is Continuous Integration? | Continuous Integration with Jenkins | DevOp...
Cucumber BDD
A GitOps Kubernetes Native CICD Solution with Argo Events, Workflows, and CD
Test Automation Framework using Cucumber BDD overview (part 1)
Introduction to Jhipster
Docker 101 - Nov 2016
A brief study on Kubernetes and its components
Ad

Viewers also liked (6)

PDF
Drush make vs composer
PDF
Da site builder a Drupal developer
PDF
Behaviour Driven Development con Behat & Drupal
PDF
Drupal for government: Iperbole, the civic network of the city of bologna
PDF
Drupal 8 - Corso frontend development
PDF
Drupal 8 - dal download del core alla pubblicazione in produzione
Drush make vs composer
Da site builder a Drupal developer
Behaviour Driven Development con Behat & Drupal
Drupal for government: Iperbole, the civic network of the city of bologna
Drupal 8 - Corso frontend development
Drupal 8 - dal download del core alla pubblicazione in produzione
Ad

Similar to Docker for developers (20)

PDF
Docker Up and Running for Web Developers
PDF
Docker up and Running For Web Developers
PPTX
Using Docker to boost your development experience with Drupal
PDF
Docker for local development
PDF
Docker primer and tips
PDF
Docker workshop GDSC_CSSC
PDF
Docker for developers
PDF
JOSA TechTalk: Introduction to docker
PPTX
Docker with WordPress
PDF
Docker in everyday development
PDF
Docker for dev
PDF
Docker workshop
PPTX
Getting started with docker (2017)
PDF
Introduction to docker and docker compose
ODP
Docker - An Introduction
ODP
DevAssistant, Docker and You
PDF
Docker+java
PDF
A Gentle Introduction to Docker and Containers
PPTX
Run automated tests in Docker
PDF
Introduction to Docker, December 2014 "Tour de France" Bordeaux Special Edition
Docker Up and Running for Web Developers
Docker up and Running For Web Developers
Using Docker to boost your development experience with Drupal
Docker for local development
Docker primer and tips
Docker workshop GDSC_CSSC
Docker for developers
JOSA TechTalk: Introduction to docker
Docker with WordPress
Docker in everyday development
Docker for dev
Docker workshop
Getting started with docker (2017)
Introduction to docker and docker compose
Docker - An Introduction
DevAssistant, Docker and You
Docker+java
A Gentle Introduction to Docker and Containers
Run automated tests in Docker
Introduction to Docker, December 2014 "Tour de France" Bordeaux Special Edition

More from sparkfabrik (20)

PDF
Talks on my machine: Drupal, Storybook e SDC
PDF
Talks on my machine: Drupal CMS versus The Cool Kids
PDF
Talks on my machine: Drupal: AI e Typesense come integrare la ricerca semantica
PDF
KCD Italy 2023 - Secure Software Supply chain for OCI Artifact on Kubernetes
PDF
20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...
PDF
IAD 2023 - 22 Years of Agile and all I got is this lousy t-shirt
PDF
2023 - Drupalcon - How Drupal builds your pages
PDF
2023 - TAC23 - Agile HR - Racconti dal fronte
PDF
CodeMotion 2023 - Deep dive nella supply chain della nostra infrastruttura cl...
PDF
What is the Secure Supply Chain and the Current State of the PHP Ecosystem
PDF
UX e Web sostenibile (UXday 2023).pdf
PDF
Drupal Dev Days Vienna 2023 - What is the secure software supply chain and th...
PDF
Deep dive nella supply chain della nostra infrastruttura cloud
PDF
KCD Italy 2022 - Application driven infrastructure with Crossplane
PDF
Come Drupal costruisce le tue pagine
PDF
Drupal 10: un framework PHP di sviluppo Cloud Native moderno
PDF
Do you know what your Drupal is doing Observe it! (DrupalCon Prague 2022)
PPTX
Do you know what your Drupal is doing_ Observe it!
PDF
Progettare e sviluppare soluzioni serverless con AWS
PPTX
From React to React Native - Things I wish I knew when I started
Talks on my machine: Drupal, Storybook e SDC
Talks on my machine: Drupal CMS versus The Cool Kids
Talks on my machine: Drupal: AI e Typesense come integrare la ricerca semantica
KCD Italy 2023 - Secure Software Supply chain for OCI Artifact on Kubernetes
20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...
IAD 2023 - 22 Years of Agile and all I got is this lousy t-shirt
2023 - Drupalcon - How Drupal builds your pages
2023 - TAC23 - Agile HR - Racconti dal fronte
CodeMotion 2023 - Deep dive nella supply chain della nostra infrastruttura cl...
What is the Secure Supply Chain and the Current State of the PHP Ecosystem
UX e Web sostenibile (UXday 2023).pdf
Drupal Dev Days Vienna 2023 - What is the secure software supply chain and th...
Deep dive nella supply chain della nostra infrastruttura cloud
KCD Italy 2022 - Application driven infrastructure with Crossplane
Come Drupal costruisce le tue pagine
Drupal 10: un framework PHP di sviluppo Cloud Native moderno
Do you know what your Drupal is doing Observe it! (DrupalCon Prague 2022)
Do you know what your Drupal is doing_ Observe it!
Progettare e sviluppare soluzioni serverless con AWS
From React to React Native - Things I wish I knew when I started

Recently uploaded (20)

PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
Understanding Forklifts - TECH EHS Solution
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
System and Network Administration Chapter 2
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
Digital Strategies for Manufacturing Companies
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
PTS Company Brochure 2025 (1).pdf.......
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
top salesforce developer skills in 2025.pdf
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
ai tools demonstartion for schools and inter college
PDF
Nekopoi APK 2025 free lastest update
PPTX
Transform Your Business with a Software ERP System
PPTX
L1 - Introduction to python Backend.pptx
PPTX
history of c programming in notes for students .pptx
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
medical staffing services at VALiNTRY
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Understanding Forklifts - TECH EHS Solution
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
System and Network Administration Chapter 2
Reimagine Home Health with the Power of Agentic AI​
Digital Strategies for Manufacturing Companies
Design an Analysis of Algorithms II-SECS-1021-03
PTS Company Brochure 2025 (1).pdf.......
Odoo POS Development Services by CandidRoot Solutions
top salesforce developer skills in 2025.pdf
2025 Textile ERP Trends: SAP, Odoo & Oracle
ai tools demonstartion for schools and inter college
Nekopoi APK 2025 free lastest update
Transform Your Business with a Software ERP System
L1 - Introduction to python Backend.pptx
history of c programming in notes for students .pptx
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
How to Migrate SBCGlobal Email to Yahoo Easily
medical staffing services at VALiNTRY

Docker for developers

  • 3. Paolo Mainardi (@paolomainardi) ● CTO @sparkfabrik ● Drupal developer ● Docker enthusiast (dropdock.io, dockerhub@paolomainardi) ● Twin of @stefanomainardi ● Linux and open source lover (ildn.net)
  • 5. ● You read the online tutorial ● You installed docker locally ● You are using for development ● You are using on production Raise your hands if
  • 6. Outlines ● What is Docker and why it is important to know it. ● What a container is and how to use it. ● Developing PHP applications using Docker. ● Tips and tricks on real world usage.
  • 7. ● To make your local development and build workflow faster, more efficient, and more lightweight. ○ If it works on my machine, it will work in production ○ No more dependency hell, different versions of PHP with their own libraries, Mysql or Mariadb, Redis or Memcache, Sass or Less compilers, NPM etc.etc. ○ Consistent development environment, same operating system, same libraries, no matter the host operating system you are running. ○ Easy way to replicate production environment. ○ Concentrate on code, instead to (re)build the infrastructure your application needs. Ok, what can I use Docker for ?
  • 9. What is Docker ? “Docker allows you to package an application with all of its dependencies into a standardized unit for software development.” https://www.docker.com/what-docker
  • 10. How it is made Docker ? ● It relies on standard linux kernel features only (cgroups, namespaces, capabilities ecc.) ● Static compiled binary based on golang, no extra moving parts. ● It natively runs on every linux distro and on mac/windows too thanks to boot2docker vm. (https://www.docker.com/docker-toolbox) ● Fast and lightweight, no added overhead. ● Security by process isolation. ● Open container initiative also baked by Docker inc. (https://www. opencontainers.org)
  • 11. Virtual machines Containers Docker is not virtualization
  • 12. What is a container ?
  • 13. What is a container ? ● It is a linux process. ● It sits on top of the base docker image (usually an operating system image). ● It has its own network interface. ● It has its own process namespace.
  • 15. Docker is a platform Docker is an open source platform to build, ship and run any app, anywhere. ● Build: Package your application in a container. ● Ship: Move that container from one host to another. ● Run: Execute your application. ● Any app: that runs on Linux (recently native Windows support) ● Anywhere: Local, remote, cloud, VM, RaspberryPI ecc. any platform capable to run the docker engine.
  • 16. Build: Dockerfiles A “Dockerfile” is a text document that contains all the commands to assemble a docker image in a programmatic and reproducible way.
  • 17. Build: Dockerfiles FROM ubuntu:14.04 RUN apt-get update && apt-get install -y nginx RUN echo 'Hi, I am in your container' >/usr/share/nginx/html/index.html CMD nginx -g "daemon off;" EXPOSE 80 $ docker build -t paolomainardi/dday15web . $ docker run -d -P paolomainardi/dday15web
  • 19. Build: What we learned ● It allows to create a docker image in a programmatic and reproducible way. ● Each build step gets cached (thanks to overlaid filesystem) ● Re-run the build allows to skip slow steps (ex: apt-get install)
  • 20. Ship
  • 21. Ship: Dockerhub ● git pull ● git push
  • 22. Ship: Dockerhub ● git docker pull image from the registry ● git docker push image to the registry http://hub.docker.com
  • 24. Ship: What we learned ● It mimics the git workflow. ● Images are self-contained, independent from the host. ● Exactly the same behaviour, on any environment. ● To easily replicate and share the environment your application expects. ● No more “it worked on my machine” excuse.
  • 27. Run: What we learned ● Execution is fast and lightweight. ● There is no overhead, they are just normal OS running processes. ● Containers are isolated.
  • 28. Any app, anywhere ● If it works on Linux, it works on Docker. ● Not just for command-line apps ○ Chrome-in-docker ○ Firefox-in-docker ○ VPN-in-docker ○ etc…follow this repo to see crazy things: https://github.com/jfrazelle/dockerfiles ● Every linux host that run Linux 3.8+ x86_64 kernel
  • 32. Docker Compose to rule them all
  • 33. Docker compose ● Describe your stack in one file docker-compose.yml ● Run your stack with a command docker-compose up
  • 34. front: image: drupal:7.41 volumes: - ./sites/all/modules:/var/www/html/sites/all/modules ports: - "8080:80" links: - mariadb:mariadb mariadb: image: mariadb:10 ports: - "3306:3306" environment: - MYSQL_ROOT_PASSWORD=root - MYSQL_DATABASE=drupal memcached: image: memcached:1.4.25 ports: - "1211:1211" solr: image: sparkfabrik/drupal-drupal-solr ports: - "8983:8983" docker-compose-yml
  • 36. The Docker ecosystem When talk about Docker, we talk about an ecosystem of tools. ● Docker engine: Client and server daemon to build, ship and run containers. ● Docker hub: The official Docker image registry. ● Docker compose: Tool to orchestrate multi-container applications. ● Docker machine: Automated Docker hosts provisioning. ● Docker swarm: Host clustering and container scheduling. Much more than this, check it out: https://www.docker.com/products/overview