Your browser doesn't support the features required by impress.js, so you are presented with a simplified version of this presentation.

For the best experience please use the latest Chrome, Safari or Firefox browser.

Docker
Development
Template
Jan Burkl
Solution Consultant
Zend, a Rogue Wave Company
jan@zend.com // @5square_de
Developer's Dream
https://www.justwatch.com/de/Film/Der-Flug-des-Navigators
1. Get Code
2. Get Dependencies
3. Start the Engines

Fast Forward
What has happened?
http://www.gamona.de/kino-dvd/deadpool-2,autoren-auch-das-sequel-benoetigt-kein-hohes-budget:news.html
docker-dev-template
https://bitbucket.org/account/user/janatzendteam/projects/DOC
My example project
What do I need?
Docker ≠ VirtualBox
one daemon
=
one container
"In almost all cases, you should
only run a single process in a single
container. Decoupling applications
into multiple containers makes it
much easier to scale horizontally
and reuse containers. If that service
depends on another service,
make use of container linking."

https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/
Docker Compose
"Compose is a tool for defining and
running multi-container Docker applications."
Challenge
http://www.foxmovies.com/movies/kingsman-the-secret-service
docker run -d -i -t -p 80:80 -p \
3000:3000 -p 3001:3001 -p \
2222:22 --name gsd alankent/gsd

docker run -it --rm --name my-running-script \
-v "$PWD":/usr/src/myapp \
-w /usr/src/myapp php:7.0-cli \
php your-script.php

Andy Weir, The Martian
Duct tape works anywhere.
Duct tape is magic and
should be worshipped.

http://the-martian-movie.tumblr.com/post/128648842093/duct-tape-here-duct-tape-there-engineering-on
docker-compose.yml
(.env)
https://bitbucket.org/janatzendteam/development/src/master/docker-compose.yml
docker-compose:
helps me defining (dev) infrastructure
Makefile
https://bitbucket.org/janatzendteam/development/src/master/Makefile
http://90to5.org/5MM/2015/ferris-buellers-day-off-1986/
make:
helps me controlling the infrastructure
Important Commands:
  • make build
  • make up
  • make stop
  • make clean
  • make docker-build
  • make exec-php
Docker Image - (pull or) build
http://www.theatlantic.com/technology/archive/2013/10/how-realistic-is-the-movie-em-gravity-em/280211/
  • Docker Hub
  • Private Docker Repository
  • Local Dockerfile
  • Remote Dockerfile
FAIL
  • Docker Updates
  • Docker Compose Updates
  • Permissions
  • Persistent Data
Permissions?
What's the problem?

  • apache writes files
  • write access for www-data
  • www-data not available on host
  • use uid and gid of local user (#)
  • chmod on apache dirs

Database
or
Where to store my persistent Data?
  • use Makefile to prepare
  • map local dir to /var/lib/mysql
Benefits
  • no huge files to handle
  • exchange containers
  • every step is documented
  • quick start
Danke schön
jan@zend.com / @5square_de
https://bitbucket.org/account/user/janatzendteam/projects/DOC
https://5square.github.io/talks/