using docker to boost your development experience with drupal

31
Jürgen Viljaste Drupal developer drupal.org/u/viljaste Mait Roosvalt Drupal developer drupal.org/u/maitzzz

Upload: dockerizedrupal

Post on 22-Jan-2018

428 views

Category:

Presentations & Public Speaking


0 download

TRANSCRIPT

Page 1: Using Docker to boost your development experience with Drupal

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

Using Docker to boost

your development

experience with Drupal

Part 1

Page 3: Using Docker to boost your development experience with Drupal

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

● Whole-system virtualization (VirtualBox)

Getting started on non Linux hosts

Page 5: Using Docker to boost your development experience with Drupal

● Whole-system virtualization (Vagrant + VirtualBox)

Getting started on non Linux hosts

Page 6: Using Docker to boost your development experience with Drupal

● Docker Toolbox

Getting started on non Linux hosts

Page 7: Using Docker to boost your development experience with Drupal

Architecture of Docker in a nutshell

Page 8: Using Docker to boost your development experience with Drupal

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

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

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

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

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

ELI5: The difference between a

Docker image and a Docker

container?

Page 14: Using Docker to boost your development experience with Drupal

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

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

Dockerfile syntax

Page 17: Using Docker to boost your development experience with Drupal

Demo

Page 18: Using Docker to boost your development experience with Drupal

Using Docker to boost

your development

experience with Drupal

Part 2

Page 19: Using Docker to boost your development experience with Drupal

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

The Accident

sudo chown -R www-data.www-data /

Page 21: Using Docker to boost your development experience with Drupal

Deploying Docker: Phase 1

Page 22: Using Docker to boost your development experience with Drupal

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

Networking made easy

Page 24: Using Docker to boost your development experience with Drupal

Deploying Docker: Phase 2

Page 25: Using Docker to boost your development experience with Drupal

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

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

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

Demo

Page 29: Using Docker to boost your development experience with Drupal

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

Contribute at

dockerizedrupal.com

Page 31: Using Docker to boost your development experience with Drupal