SlideShare a Scribd company logo
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

What's hot

from docker run to docker compose (Webelement #36)
from docker run to docker compose (Webelement #36)from docker run to docker compose (Webelement #36)
from docker run to docker compose (Webelement #36)
Adam Štipák
 
Scale Big With Docker — Moboom 2014
Scale Big With Docker — Moboom 2014Scale Big With Docker — Moboom 2014
Scale Big With Docker — Moboom 2014Jérôme Petazzoni
 
DockerCon 2016 Seattle Recap
DockerCon 2016 Seattle RecapDockerCon 2016 Seattle Recap
DockerCon 2016 Seattle Recap
Philipp Garbe
 
Docker session III: Dockerfile
Docker session III: DockerfileDocker session III: Dockerfile
Docker session III: Dockerfile
Degendra Sivakoti
 
Better delivery with DevOps Driven Development
Better delivery with DevOps Driven DevelopmentBetter delivery with DevOps Driven Development
Better delivery with DevOps Driven Development
Jirayut Nimsaeng
 
Docker for Drupal development
Docker for Drupal developmentDocker for Drupal development
Docker for Drupal development
William Mortada
 
Docker session I: Continuous integration, delivery and deployment
Docker session I: Continuous integration, delivery and deploymentDocker session I: Continuous integration, delivery and deployment
Docker session I: Continuous integration, delivery and deployment
Degendra Sivakoti
 
DockerCon 2016 Recap
DockerCon 2016 RecapDockerCon 2016 Recap
DockerCon 2016 Recap
Jochen Zehnder
 
Run automated tests in Docker
Run automated tests in DockerRun automated tests in Docker
Run automated tests in Docker
Oleksandr Metelytsia
 
JOSA TechTalk: Taking Docker to Production
JOSA TechTalk: Taking Docker to ProductionJOSA TechTalk: Taking Docker to Production
JOSA TechTalk: Taking Docker to Production
Jordan Open Source Association
 
Vagrant + Ansible + Docker
Vagrant + Ansible + DockerVagrant + Ansible + Docker
Vagrant + Ansible + Docker
Vijay Selvaraj
 
Create Dynamic console with OSGi and Adobe Flex
Create Dynamic console with OSGi and Adobe FlexCreate Dynamic console with OSGi and Adobe Flex
Create Dynamic console with OSGi and Adobe Flex
Florent BENOIT
 
Docker off the grid
Docker off the gridDocker off the grid
Docker off the grid
Mirantis IT Russia
 
Docker for dummies
Docker for dummiesDocker for dummies
Docker for dummies
SIVALINGAPANDIAN VELAYUTHAM
 
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
Docker, Inc.
 
Docker from a team perspective
Docker from a team perspectiveDocker from a team perspective
Docker from a team perspective
Edwin Vlieg
 
Boston Code Dojo - Docker meetup slides
Boston Code Dojo - Docker meetup slidesBoston Code Dojo - Docker meetup slides
Boston Code Dojo - Docker meetup slides
Calvin Froedge
 
Docker at MoneyBird
Docker at MoneyBirdDocker at MoneyBird
Docker at MoneyBird
Edwin Vlieg
 
Dockerizing stashboard - Docker meetup at Twilio
Dockerizing stashboard - Docker meetup at TwilioDockerizing stashboard - Docker meetup at Twilio
Dockerizing stashboard - Docker meetup at Twilio
dotCloud
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
Marcelo Cenerino
 

What's hot (20)

from docker run to docker compose (Webelement #36)
from docker run to docker compose (Webelement #36)from docker run to docker compose (Webelement #36)
from docker run to docker compose (Webelement #36)
 
Scale Big With Docker — Moboom 2014
Scale Big With Docker — Moboom 2014Scale Big With Docker — Moboom 2014
Scale Big With Docker — Moboom 2014
 
DockerCon 2016 Seattle Recap
DockerCon 2016 Seattle RecapDockerCon 2016 Seattle Recap
DockerCon 2016 Seattle Recap
 
Docker session III: Dockerfile
Docker session III: DockerfileDocker session III: Dockerfile
Docker session III: Dockerfile
 
Better delivery with DevOps Driven Development
Better delivery with DevOps Driven DevelopmentBetter delivery with DevOps Driven Development
Better delivery with DevOps Driven Development
 
Docker for Drupal development
Docker for Drupal developmentDocker for Drupal development
Docker for Drupal development
 
Docker session I: Continuous integration, delivery and deployment
Docker session I: Continuous integration, delivery and deploymentDocker session I: Continuous integration, delivery and deployment
Docker session I: Continuous integration, delivery and deployment
 
DockerCon 2016 Recap
DockerCon 2016 RecapDockerCon 2016 Recap
DockerCon 2016 Recap
 
Run automated tests in Docker
Run automated tests in DockerRun automated tests in Docker
Run automated tests in Docker
 
JOSA TechTalk: Taking Docker to Production
JOSA TechTalk: Taking Docker to ProductionJOSA TechTalk: Taking Docker to Production
JOSA TechTalk: Taking Docker to Production
 
Vagrant + Ansible + Docker
Vagrant + Ansible + DockerVagrant + Ansible + Docker
Vagrant + Ansible + Docker
 
Create Dynamic console with OSGi and Adobe Flex
Create Dynamic console with OSGi and Adobe FlexCreate Dynamic console with OSGi and Adobe Flex
Create Dynamic console with OSGi and Adobe Flex
 
Docker off the grid
Docker off the gridDocker off the grid
Docker off the grid
 
Docker for dummies
Docker for dummiesDocker for dummies
Docker for dummies
 
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
 
Docker from a team perspective
Docker from a team perspectiveDocker from a team perspective
Docker from a team perspective
 
Boston Code Dojo - Docker meetup slides
Boston Code Dojo - Docker meetup slidesBoston Code Dojo - Docker meetup slides
Boston Code Dojo - Docker meetup slides
 
Docker at MoneyBird
Docker at MoneyBirdDocker at MoneyBird
Docker at MoneyBird
 
Dockerizing stashboard - Docker meetup at Twilio
Dockerizing stashboard - Docker meetup at TwilioDockerizing stashboard - Docker meetup at Twilio
Dockerizing stashboard - Docker meetup at Twilio
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 

Viewers also liked

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

Viewers also liked (6)

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

Similar to Docker for developers

Docker up and Running For Web Developers
Docker up and Running For Web DevelopersDocker up and Running For Web Developers
Docker up and Running For Web Developers
BADR
 
Docker Up and Running for Web Developers
Docker Up and Running for Web DevelopersDocker Up and Running for Web Developers
Docker Up and Running for Web Developers
Amr Fawzy
 
Using Docker to boost your development experience with Drupal
Using Docker to boost your development experience with DrupalUsing Docker to boost your development experience with Drupal
Using Docker to boost your development experience with Drupal
dockerizedrupal
 
Docker primer and tips
Docker primer and tipsDocker primer and tips
Docker primer and tips
Samuel Chow
 
Docker workshop GDSC_CSSC
Docker workshop GDSC_CSSCDocker workshop GDSC_CSSC
Docker workshop GDSC_CSSC
GDSC UofT Mississauga
 
JOSA TechTalk: Introduction to docker
JOSA TechTalk: Introduction to dockerJOSA TechTalk: Introduction to docker
JOSA TechTalk: Introduction to docker
Jordan Open Source Association
 
Docker with WordPress
Docker with WordPressDocker with WordPress
Docker with WordPress
Imran Sayed
 
Docker in everyday development
Docker in everyday developmentDocker in everyday development
Docker in everyday development
Justyna Ilczuk
 
Docker workshop
Docker workshopDocker workshop
Docker workshop
Rafael Dutra
 
Getting started with docker (2017)
Getting started with docker (2017)Getting started with docker (2017)
Getting started with docker (2017)
JEMLI Fathi
 
Introduction to docker and docker compose
Introduction to docker and docker composeIntroduction to docker and docker compose
Introduction to docker and docker compose
Lalatendu Mohanty
 
Docker - An Introduction
Docker - An IntroductionDocker - An Introduction
Docker - An Introduction
Knoldus Inc.
 
DevAssistant, Docker and You
DevAssistant, Docker and YouDevAssistant, Docker and You
DevAssistant, Docker and You
BalaBit
 
Docker+java
Docker+javaDocker+java
Docker+java
DPC Consulting Ltd
 
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, December 2014 "Tour de France" Bordeaux Special Edition
Introduction to Docker, December 2014 "Tour de France" Bordeaux Special EditionIntroduction to Docker, December 2014 "Tour de France" Bordeaux Special Edition
Introduction to Docker, December 2014 "Tour de France" Bordeaux Special Edition
Jérôme Petazzoni
 
JOSA TechTalks - Docker in Production
JOSA TechTalks - Docker in ProductionJOSA TechTalks - Docker in Production
JOSA TechTalks - Docker in Production
Jordan Open Source Association
 
Docker Basics
Docker BasicsDocker Basics
Docker Basics
ParagKhalas
 
Adventures in docker compose
Adventures in docker composeAdventures in docker compose
Adventures in docker compose
LinkMe Srl
 
[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101
Naukri.com
 

Similar to Docker for developers (20)

Docker up and Running For Web Developers
Docker up and Running For Web DevelopersDocker up and Running For Web Developers
Docker up and Running For Web Developers
 
Docker Up and Running for Web Developers
Docker Up and Running for Web DevelopersDocker Up and Running for Web Developers
Docker Up and Running for Web Developers
 
Using Docker to boost your development experience with Drupal
Using Docker to boost your development experience with DrupalUsing Docker to boost your development experience with Drupal
Using Docker to boost your development experience with Drupal
 
Docker primer and tips
Docker primer and tipsDocker primer and tips
Docker primer and tips
 
Docker workshop GDSC_CSSC
Docker workshop GDSC_CSSCDocker workshop GDSC_CSSC
Docker workshop GDSC_CSSC
 
JOSA TechTalk: Introduction to docker
JOSA TechTalk: Introduction to dockerJOSA TechTalk: Introduction to docker
JOSA TechTalk: Introduction to docker
 
Docker with WordPress
Docker with WordPressDocker with WordPress
Docker with WordPress
 
Docker in everyday development
Docker in everyday developmentDocker in everyday development
Docker in everyday development
 
Docker workshop
Docker workshopDocker workshop
Docker workshop
 
Getting started with docker (2017)
Getting started with docker (2017)Getting started with docker (2017)
Getting started with docker (2017)
 
Introduction to docker and docker compose
Introduction to docker and docker composeIntroduction to docker and docker compose
Introduction to docker and docker compose
 
Docker - An Introduction
Docker - An IntroductionDocker - An Introduction
Docker - An Introduction
 
DevAssistant, Docker and You
DevAssistant, Docker and YouDevAssistant, Docker and You
DevAssistant, Docker and You
 
Docker+java
Docker+javaDocker+java
Docker+java
 
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, December 2014 "Tour de France" Bordeaux Special Edition
Introduction to Docker, December 2014 "Tour de France" Bordeaux Special EditionIntroduction to Docker, December 2014 "Tour de France" Bordeaux Special Edition
Introduction to Docker, December 2014 "Tour de France" Bordeaux Special Edition
 
JOSA TechTalks - Docker in Production
JOSA TechTalks - Docker in ProductionJOSA TechTalks - Docker in Production
JOSA TechTalks - Docker in Production
 
Docker Basics
Docker BasicsDocker Basics
Docker Basics
 
Adventures in docker compose
Adventures in docker composeAdventures in docker compose
Adventures in docker compose
 
[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101
 

More from sparkfabrik

KCD Italy 2023 - Secure Software Supply chain for OCI Artifact on Kubernetes
KCD Italy 2023 - Secure Software Supply chain for OCI Artifact on KubernetesKCD Italy 2023 - Secure Software Supply chain for OCI Artifact on Kubernetes
KCD Italy 2023 - Secure Software Supply chain for OCI Artifact on Kubernetes
sparkfabrik
 
20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...
20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...
20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...
sparkfabrik
 
IAD 2023 - 22 Years of Agile and all I got is this lousy t-shirt
IAD 2023 - 22 Years of Agile and all I got is this lousy t-shirtIAD 2023 - 22 Years of Agile and all I got is this lousy t-shirt
IAD 2023 - 22 Years of Agile and all I got is this lousy t-shirt
sparkfabrik
 
2023 - Drupalcon - How Drupal builds your pages
2023 - Drupalcon - How Drupal builds your pages2023 - Drupalcon - How Drupal builds your pages
2023 - Drupalcon - How Drupal builds your pages
sparkfabrik
 
2023 - TAC23 - Agile HR - Racconti dal fronte
2023 - TAC23 - Agile HR - Racconti dal fronte2023 - TAC23 - Agile HR - Racconti dal fronte
2023 - TAC23 - Agile HR - Racconti dal fronte
sparkfabrik
 
CodeMotion 2023 - Deep dive nella supply chain della nostra infrastruttura cl...
CodeMotion 2023 - Deep dive nella supply chain della nostra infrastruttura cl...CodeMotion 2023 - Deep dive nella supply chain della nostra infrastruttura cl...
CodeMotion 2023 - Deep dive nella supply chain della nostra infrastruttura cl...
sparkfabrik
 
What is the Secure Supply Chain and the Current State of the PHP Ecosystem
What is the Secure Supply Chain and the Current State of the PHP EcosystemWhat is the Secure Supply Chain and the Current State of the PHP Ecosystem
What is the Secure Supply Chain and the Current State of the PHP Ecosystem
sparkfabrik
 
UX e Web sostenibile (UXday 2023).pdf
UX e Web sostenibile (UXday 2023).pdfUX e Web sostenibile (UXday 2023).pdf
UX e Web sostenibile (UXday 2023).pdf
sparkfabrik
 
Drupal Dev Days Vienna 2023 - What is the secure software supply chain and th...
Drupal Dev Days Vienna 2023 - What is the secure software supply chain and th...Drupal Dev Days Vienna 2023 - What is the secure software supply chain and th...
Drupal Dev Days Vienna 2023 - What is the secure software supply chain and th...
sparkfabrik
 
Deep dive nella supply chain della nostra infrastruttura cloud
Deep dive nella supply chain della nostra infrastruttura cloudDeep dive nella supply chain della nostra infrastruttura cloud
Deep dive nella supply chain della nostra infrastruttura cloud
sparkfabrik
 
KCD Italy 2022 - Application driven infrastructure with Crossplane
KCD Italy 2022 - Application driven infrastructure with CrossplaneKCD Italy 2022 - Application driven infrastructure with Crossplane
KCD Italy 2022 - Application driven infrastructure with Crossplane
sparkfabrik
 
Come Drupal costruisce le tue pagine
Come Drupal costruisce le tue pagineCome Drupal costruisce le tue pagine
Come Drupal costruisce le tue pagine
sparkfabrik
 
Drupal 10: un framework PHP di sviluppo Cloud Native moderno
Drupal 10: un framework PHP di sviluppo Cloud Native modernoDrupal 10: un framework PHP di sviluppo Cloud Native moderno
Drupal 10: un framework PHP di sviluppo Cloud Native moderno
sparkfabrik
 
Do you know what your Drupal is doing Observe it! (DrupalCon Prague 2022)
Do you know what your Drupal is doing Observe it! (DrupalCon Prague 2022)Do you know what your Drupal is doing Observe it! (DrupalCon Prague 2022)
Do you know what your Drupal is doing Observe it! (DrupalCon Prague 2022)
sparkfabrik
 
Do you know what your Drupal is doing_ Observe it!
Do you know what your Drupal is doing_ Observe it!Do you know what your Drupal is doing_ Observe it!
Do you know what your Drupal is doing_ Observe it!
sparkfabrik
 
Progettare e sviluppare soluzioni serverless con AWS
Progettare e sviluppare soluzioni serverless con AWSProgettare e sviluppare soluzioni serverless con AWS
Progettare e sviluppare soluzioni serverless con AWS
sparkfabrik
 
From React to React Native - Things I wish I knew when I started
From React to React Native - Things I wish I knew when I startedFrom React to React Native - Things I wish I knew when I started
From React to React Native - Things I wish I knew when I started
sparkfabrik
 
Headless Drupal: A modern approach to (micro)services and APIs
Headless Drupal: A modern approach to (micro)services and APIsHeadless Drupal: A modern approach to (micro)services and APIs
Headless Drupal: A modern approach to (micro)services and APIs
sparkfabrik
 
Cloud-Native Drupal: a survival guide
Cloud-Native Drupal: a survival guideCloud-Native Drupal: a survival guide
Cloud-Native Drupal: a survival guide
sparkfabrik
 
Mobile Development: una introduzione per Web Developers
Mobile Development: una introduzione per Web DevelopersMobile Development: una introduzione per Web Developers
Mobile Development: una introduzione per Web Developers
sparkfabrik
 

More from sparkfabrik (20)

KCD Italy 2023 - Secure Software Supply chain for OCI Artifact on Kubernetes
KCD Italy 2023 - Secure Software Supply chain for OCI Artifact on KubernetesKCD Italy 2023 - Secure Software Supply chain for OCI Artifact on Kubernetes
KCD Italy 2023 - Secure Software Supply chain for OCI Artifact on Kubernetes
 
20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...
20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...
20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...
 
IAD 2023 - 22 Years of Agile and all I got is this lousy t-shirt
IAD 2023 - 22 Years of Agile and all I got is this lousy t-shirtIAD 2023 - 22 Years of Agile and all I got is this lousy t-shirt
IAD 2023 - 22 Years of Agile and all I got is this lousy t-shirt
 
2023 - Drupalcon - How Drupal builds your pages
2023 - Drupalcon - How Drupal builds your pages2023 - Drupalcon - How Drupal builds your pages
2023 - Drupalcon - How Drupal builds your pages
 
2023 - TAC23 - Agile HR - Racconti dal fronte
2023 - TAC23 - Agile HR - Racconti dal fronte2023 - TAC23 - Agile HR - Racconti dal fronte
2023 - TAC23 - Agile HR - Racconti dal fronte
 
CodeMotion 2023 - Deep dive nella supply chain della nostra infrastruttura cl...
CodeMotion 2023 - Deep dive nella supply chain della nostra infrastruttura cl...CodeMotion 2023 - Deep dive nella supply chain della nostra infrastruttura cl...
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
What is the Secure Supply Chain and the Current State of the PHP EcosystemWhat is the Secure Supply Chain and the Current State of the PHP Ecosystem
What is the Secure Supply Chain and the Current State of the PHP Ecosystem
 
UX e Web sostenibile (UXday 2023).pdf
UX e Web sostenibile (UXday 2023).pdfUX e Web sostenibile (UXday 2023).pdf
UX e Web sostenibile (UXday 2023).pdf
 
Drupal Dev Days Vienna 2023 - What is the secure software supply chain and th...
Drupal Dev Days Vienna 2023 - What is the secure software supply chain and th...Drupal Dev Days Vienna 2023 - What is the secure software supply chain and th...
Drupal Dev Days Vienna 2023 - What is the secure software supply chain and th...
 
Deep dive nella supply chain della nostra infrastruttura cloud
Deep dive nella supply chain della nostra infrastruttura cloudDeep dive nella supply chain della nostra infrastruttura cloud
Deep dive nella supply chain della nostra infrastruttura cloud
 
KCD Italy 2022 - Application driven infrastructure with Crossplane
KCD Italy 2022 - Application driven infrastructure with CrossplaneKCD Italy 2022 - Application driven infrastructure with Crossplane
KCD Italy 2022 - Application driven infrastructure with Crossplane
 
Come Drupal costruisce le tue pagine
Come Drupal costruisce le tue pagineCome Drupal costruisce le tue pagine
Come Drupal costruisce le tue pagine
 
Drupal 10: un framework PHP di sviluppo Cloud Native moderno
Drupal 10: un framework PHP di sviluppo Cloud Native modernoDrupal 10: un framework PHP di sviluppo Cloud Native moderno
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! (DrupalCon Prague 2022)Do you know what your Drupal is doing Observe it! (DrupalCon Prague 2022)
Do you know what your Drupal is doing Observe it! (DrupalCon Prague 2022)
 
Do you know what your Drupal is doing_ Observe it!
Do you know what your Drupal is doing_ Observe it!Do you know what your Drupal is doing_ Observe it!
Do you know what your Drupal is doing_ Observe it!
 
Progettare e sviluppare soluzioni serverless con AWS
Progettare e sviluppare soluzioni serverless con AWSProgettare e sviluppare soluzioni serverless con AWS
Progettare e sviluppare soluzioni serverless con AWS
 
From React to React Native - Things I wish I knew when I started
From React to React Native - Things I wish I knew when I startedFrom React to React Native - Things I wish I knew when I started
From React to React Native - Things I wish I knew when I started
 
Headless Drupal: A modern approach to (micro)services and APIs
Headless Drupal: A modern approach to (micro)services and APIsHeadless Drupal: A modern approach to (micro)services and APIs
Headless Drupal: A modern approach to (micro)services and APIs
 
Cloud-Native Drupal: a survival guide
Cloud-Native Drupal: a survival guideCloud-Native Drupal: a survival guide
Cloud-Native Drupal: a survival guide
 
Mobile Development: una introduzione per Web Developers
Mobile Development: una introduzione per Web DevelopersMobile Development: una introduzione per Web Developers
Mobile Development: una introduzione per Web Developers
 

Recently uploaded

In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Mind IT Systems
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
Pro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp BookPro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp Book
abdulrafaychaudhry
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Enterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptxEnterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptx
QuickwayInfoSystems3
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 

Recently uploaded (20)

In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
Pro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp BookPro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp Book
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Enterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptxEnterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptx
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 

Docker for developers

  • 1.
  • 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