using docker to boost your development experience with drupal
TRANSCRIPT
![Page 1: Using Docker to boost your development experience with Drupal](https://reader031.vdocuments.us/reader031/viewer/2022030319/58e97f1e1a28aba6498b4dc9/html5/thumbnails/1.jpg)
Jürgen Viljaste
Drupal developer
drupal.org/u/viljaste
Mait Roosvalt
Drupal developer
drupal.org/u/maitzzz
![Page 2: Using Docker to boost your development experience with Drupal](https://reader031.vdocuments.us/reader031/viewer/2022030319/58e97f1e1a28aba6498b4dc9/html5/thumbnails/2.jpg)
Using Docker to boost
your development
experience with Drupal
Part 1
![Page 3: Using Docker to boost your development experience with Drupal](https://reader031.vdocuments.us/reader031/viewer/2022030319/58e97f1e1a28aba6498b4dc9/html5/thumbnails/3.jpg)
High level explanation of Docker
● Wraps all the pieces of your application into a
standardized package
● Allows you to run your application virtually in any host
● Makes it very easy to share your application with others
![Page 4: Using Docker to boost your development experience with Drupal](https://reader031.vdocuments.us/reader031/viewer/2022030319/58e97f1e1a28aba6498b4dc9/html5/thumbnails/4.jpg)
● Whole-system virtualization (VirtualBox)
Getting started on non Linux hosts
![Page 5: Using Docker to boost your development experience with Drupal](https://reader031.vdocuments.us/reader031/viewer/2022030319/58e97f1e1a28aba6498b4dc9/html5/thumbnails/5.jpg)
● Whole-system virtualization (Vagrant + VirtualBox)
Getting started on non Linux hosts
![Page 6: Using Docker to boost your development experience with Drupal](https://reader031.vdocuments.us/reader031/viewer/2022030319/58e97f1e1a28aba6498b4dc9/html5/thumbnails/6.jpg)
● Docker Toolbox
Getting started on non Linux hosts
![Page 7: Using Docker to boost your development experience with Drupal](https://reader031.vdocuments.us/reader031/viewer/2022030319/58e97f1e1a28aba6498b4dc9/html5/thumbnails/7.jpg)
Architecture of Docker in a nutshell
![Page 8: Using Docker to boost your development experience with Drupal](https://reader031.vdocuments.us/reader031/viewer/2022030319/58e97f1e1a28aba6498b4dc9/html5/thumbnails/8.jpg)
What makes Linux so special?
● Container-based virtualization (Operating-system-level
virtualization) support by the kernel
● Considered mainstream operating system in the
technology world
![Page 9: Using Docker to boost your development experience with Drupal](https://reader031.vdocuments.us/reader031/viewer/2022030319/58e97f1e1a28aba6498b4dc9/html5/thumbnails/9.jpg)
Why is container-based
virtualization important?
● Efficiency - the amount of resources (CPU, RAM, disk
space etc.) you have available on your system can be
directly translated to the complexity of projects you can
develop on a single machine
● Speed - the faster you can start and rebuild your
application, the faster you can get the feedback and
solve problems
![Page 10: Using Docker to boost your development experience with Drupal](https://reader031.vdocuments.us/reader031/viewer/2022030319/58e97f1e1a28aba6498b4dc9/html5/thumbnails/10.jpg)
What is a Docker image?
● A read-only template that contains a collection of files
that your application needs in order to run
● Can be easily shared via centralized registries or
exported to a file
![Page 11: Using Docker to boost your development experience with Drupal](https://reader031.vdocuments.us/reader031/viewer/2022030319/58e97f1e1a28aba6498b4dc9/html5/thumbnails/11.jpg)
Ways to build a Docker image
● Manually - easy to perform, in practice hard to manage
● Automatically through a Dockerfile - prefered way to
build an image
![Page 12: Using Docker to boost your development experience with Drupal](https://reader031.vdocuments.us/reader031/viewer/2022030319/58e97f1e1a28aba6498b4dc9/html5/thumbnails/12.jpg)
What is a Docker container
● Isolated virtual environment for your application
● Feels like a lightweight virtual machine
● More efficient by sharing host’s operating system kernel
with other containers, but still gives you virtual machine
like capabilities
● Launched from a Docker image
● Fine control over resource allocation
● Per container monitoring
● Startup time is measurable in seconds
![Page 13: Using Docker to boost your development experience with Drupal](https://reader031.vdocuments.us/reader031/viewer/2022030319/58e97f1e1a28aba6498b4dc9/html5/thumbnails/13.jpg)
ELI5: The difference between a
Docker image and a Docker
container?
![Page 14: Using Docker to boost your development experience with Drupal](https://reader031.vdocuments.us/reader031/viewer/2022030319/58e97f1e1a28aba6498b4dc9/html5/thumbnails/14.jpg)
Dockerfile basics
● A file that contains a series of instructions on how to
build an image
● Very easy to get started with if you already know how to
use command line interface
![Page 15: Using Docker to boost your development experience with Drupal](https://reader031.vdocuments.us/reader031/viewer/2022030319/58e97f1e1a28aba6498b4dc9/html5/thumbnails/15.jpg)
Writing non-interactive commands
apt-get install apache2
Requires user interaction, image build process will fail if
used in a Dockerfile
apt-get install -y apache2
Doesn’t require user interaction, command will install
Apache without asking confirmation, OK to use in a
Dockerfile
![Page 16: Using Docker to boost your development experience with Drupal](https://reader031.vdocuments.us/reader031/viewer/2022030319/58e97f1e1a28aba6498b4dc9/html5/thumbnails/16.jpg)
Dockerfile syntax
![Page 17: Using Docker to boost your development experience with Drupal](https://reader031.vdocuments.us/reader031/viewer/2022030319/58e97f1e1a28aba6498b4dc9/html5/thumbnails/17.jpg)
Demo
![Page 18: Using Docker to boost your development experience with Drupal](https://reader031.vdocuments.us/reader031/viewer/2022030319/58e97f1e1a28aba6498b4dc9/html5/thumbnails/18.jpg)
Using Docker to boost
your development
experience with Drupal
Part 2
![Page 19: Using Docker to boost your development experience with Drupal](https://reader031.vdocuments.us/reader031/viewer/2022030319/58e97f1e1a28aba6498b4dc9/html5/thumbnails/19.jpg)
The Dark Ages
● Development environment not scalable due to using
inefficient tools and workflows
● Fixing a simple bug requires higher level of skill
● Front-end developers directly affected by issues that
shouldn’t belong to their domain
● Development cost higher than it should be
![Page 20: Using Docker to boost your development experience with Drupal](https://reader031.vdocuments.us/reader031/viewer/2022030319/58e97f1e1a28aba6498b4dc9/html5/thumbnails/20.jpg)
The Accident
sudo chown -R www-data.www-data /
![Page 21: Using Docker to boost your development experience with Drupal](https://reader031.vdocuments.us/reader031/viewer/2022030319/58e97f1e1a28aba6498b4dc9/html5/thumbnails/21.jpg)
Deploying Docker: Phase 1
![Page 22: Using Docker to boost your development experience with Drupal](https://reader031.vdocuments.us/reader031/viewer/2022030319/58e97f1e1a28aba6498b4dc9/html5/thumbnails/22.jpg)
Container + Drush = Crush
● Version agnostic wrapper around Drush that allows a
developer to use Drush seamlessly with containers
● Written in Bash, in the future should be ported to a
language that has a better support in Windows
● Supports Drupal 6, 7 and 8
![Page 23: Using Docker to boost your development experience with Drupal](https://reader031.vdocuments.us/reader031/viewer/2022030319/58e97f1e1a28aba6498b4dc9/html5/thumbnails/23.jpg)
Networking made easy
![Page 24: Using Docker to boost your development experience with Drupal](https://reader031.vdocuments.us/reader031/viewer/2022030319/58e97f1e1a28aba6498b4dc9/html5/thumbnails/24.jpg)
Deploying Docker: Phase 2
![Page 25: Using Docker to boost your development experience with Drupal](https://reader031.vdocuments.us/reader031/viewer/2022030319/58e97f1e1a28aba6498b4dc9/html5/thumbnails/25.jpg)
virtual + host = vhost
● The front page of your
development
environment
● Lists all your running
containers on a single
web page
● Access containers easily
through DNS
![Page 26: Using Docker to boost your development experience with Drupal](https://reader031.vdocuments.us/reader031/viewer/2022030319/58e97f1e1a28aba6498b4dc9/html5/thumbnails/26.jpg)
Drupal Compose
● Generates general purpose docker-
compose.yml file automatically for your
Drupal 6, 7 and 8 projects
● Developer can start working on a new
project immediately
![Page 27: Using Docker to boost your development experience with Drupal](https://reader031.vdocuments.us/reader031/viewer/2022030319/58e97f1e1a28aba6498b4dc9/html5/thumbnails/27.jpg)
On-premises Docker registry
● Stores our project specific Docker images that shouldn't
be available to public
● Saves lots of time, developers don't have to build
project images on their machine if they just want to
consume them
![Page 28: Using Docker to boost your development experience with Drupal](https://reader031.vdocuments.us/reader031/viewer/2022030319/58e97f1e1a28aba6498b4dc9/html5/thumbnails/28.jpg)
Demo
![Page 29: Using Docker to boost your development experience with Drupal](https://reader031.vdocuments.us/reader031/viewer/2022030319/58e97f1e1a28aba6498b4dc9/html5/thumbnails/29.jpg)
Conclusion
● Docker helped us to make our development
environments and people working together more
efficient
● Having a system in place that doesn't require any
knowledge of setting up your project, no matter what is
your skill level you can still fix bugs or develop new
features to any existing project
● More complex projects are easier to work with and
maintain
![Page 30: Using Docker to boost your development experience with Drupal](https://reader031.vdocuments.us/reader031/viewer/2022030319/58e97f1e1a28aba6498b4dc9/html5/thumbnails/30.jpg)
Contribute at
dockerizedrupal.com
![Page 31: Using Docker to boost your development experience with Drupal](https://reader031.vdocuments.us/reader031/viewer/2022030319/58e97f1e1a28aba6498b4dc9/html5/thumbnails/31.jpg)