Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Drupal on Docker

Drupal on Docker

In this talk, I highlighted the most important features of Docker and demonstrated how you can use it to create an amazingly efficient environment for Drupal development.

3abfc9128fe1aeae3058edc36936f360?s=128

Jochen Lillich
PRO

May 23, 2015
Tweet

Transcript

  1. Drupal on Docker © 2015 freistil IT Ltd

  2. Jochen Lillich @geewiz CEO freistil IT © 2015 freistil IT

    Ltd
  3. Managed Hosting Platform freistilbox.com @freistilbox © 2015 freistil IT Ltd

  4. "Docker is an open platform for developers and sysadmins to

    build, ship, and run distributed applications.” © 2015 freistil IT Ltd
  5. Container • Runtime environment for a process • Package <

    Docker image < VM • Isolation instead of virtualisation © 2015 freistil IT Ltd
  6. Images • Build from Dockerfile • Alternative build tools like

    Packer © 2015 freistil IT Ltd
  7. Union file system © 2015 freistil IT Ltd

  8. Deduplication © 2015 freistil IT Ltd

  9. Volumes • files persist on the host • same lifetime

    as container • can be shared between containers © 2015 freistil IT Ltd
  10. Use cases • Application container • Service container • Testing

    environment • Maintenance tools • Development environment © 2015 freistil IT Ltd
  11. Docker for DevOps © 2015 freistil IT Ltd

  12. © 2015 freistil IT Ltd

  13. Example Dockerfile Preamble FROM ubuntu:trusty MAINTAINER Jochen Lillich <jochen@freistil.it> ©

    2015 freistil IT Ltd
  14. Example Dockerfile Install packages RUN apt-get update && \ apt-get

    -y install \ apache2 \ && apt-get clean && \ rm -rf /var/lib/apt/lists/* © 2015 freistil IT Ltd
  15. Example Dockerfile Prepare runtime environment RUN mkdir -p /var/run/apache2 RUN

    echo "ServerName localhost" \ >>/etc/apache2/apache2.conf RUN sed -i -e 's/^ErrorLog .*/ErrorLog \/dev\/stdout/' \ /etc/apache2/apache2.conf © 2015 freistil IT Ltd
  16. Example Dockerfile Set environment variables ENV APACHE_RUN_USER www-data ENV APACHE_RUN_GROUP

    www-data ENV APACHE_LOG_DIR /var/log/apache2 ENV APACHE_LOCK_DIR /var/run/apache2 ENV APACHE_PID_FILE /var/run/apache2.pid © 2015 freistil IT Ltd
  17. Example Dockerfile Connect to the outside world VOLUME /var/www/html EXPOSE

    80 © 2015 freistil IT Ltd
  18. Example Dockerfile Start the service CMD ["/usr/sbin/apache2", "-D", "FOREGROUND"] ©

    2015 freistil IT Ltd
  19. Demo time! © 2015 freistil IT Ltd

  20. Docker for Drupal • LAMP • Drupal code • Application

    setup © 2015 freistil IT Ltd
  21. But what about "single service?" © 2015 freistil IT Ltd

  22. Demo time! Again! © 2015 freistil IT Ltd

  23. Dockerfiles • https://github.com/freistil/freistil-docker-lamp • https://github.com/freistil/freistil-docker-drupal © 2015 freistil IT Ltd

  24. Where to go from here • Compose • Swarm •

    Weave, Flannel • Flocker • CoreOS, Deis • Kubernetes © 2015 freistil IT Ltd
  25. Thank you! jochen@freistil.it © 2015 freistil IT Ltd