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

BridgeDevProductionGapDocker.pdf

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers.
Avatar for John Oerter John Oerter
September 05, 2016

 BridgeDevProductionGapDocker.pdf

How many times have you implemented a feature in your development environment only to see it fail in production? This happens because our development, testing, and production environments often have significant differences that make shipping software less reliable. This talk will detail how to bridge this "gap" in environments with Docker.

Vagrant has helped us create reproducible development environments, but is hard to extend to production. Provisioning tools like Chef and Puppet can automate DevOps infrastructure, but aren't meant for development. Docker and containerization, however, allows us to duplicate our tools across environments to enable faster and more reliable deployments. We will learn about the best practices in achieving this goal, as well as the current challenges.

Avatar for John Oerter

John Oerter

September 05, 2016
Tweet

More Decks by John Oerter

Other Decks in Programming

Transcript

  1. Continuous Delivery •The app is always in a deployable state

    •Keeping software deployable is prioritized over new features •A deployment pipeline is used to automate as much as possible http://martinfowler.com/bliki/ContinuousDelivery.html
  2. “Keep development, staging, and production as similar as possible“ -

    The Twelve Factor App https://12factor.net/dev-prod-parity Dev/Prod Parity
  3. Dockerfile Image Registry Container $ docker build $ docker run

    $ docker push $ docker pull $ docker run
  4. $ docker build my-app:latest . $ docker run my-app npm

    test Developers push a new version of the app to source control CI is triggered via webhook Docker image built from Dockerfile A container is created to run tests If the tests pass, the image is pushed to the Trusted Registry $ docker push my-app:latest $ git push origin master Run the updated image $ docker pull my-app:latest
  5. Development Production OS PHP version Database OS X Linux Web

    server Apache Nginx 5.5 7.0 MySQL Postgres
  6. "Before using Docker, we had issues with developers, CI and

    prod running sometimes different versions our datastores. By containerizing everything, we now develop on the exact same version/environment that is used on CI, staging and prod. If it works locally, we won’t have any surprises going through the pipeline." Matt Aimonetti, co-founder and CTO of Splice https://blog.docker.com/2016/06/docker-for-mac-splice/
  7. • Background • http://www.infoworld.com/article/3072929/linux/containers-101-linux-containers-and-docker- explained.html • https://aucouranton.com/2014/06/13/linux-containers-parallels-lxc-openvz-docker-and-more/ • http://stackoverflow.com/questions/16047306/how-is-docker-different-from-a-normal-virtual- machine

    • In the wild • https://blog.docker.com/2014/06/dockercon-video-docket-at-spotify-by-rohan-singh/ • http://www.infoworld.com/article/3112875/application-development/lessons-from-launching- billions-of-docker-containers.html • https://www.infoq.com/presentations/test-container-stack? utm_campaign=infoq_content&utm_source=infoq&utm_medium=feed&utm_term=global • Examples • https://github.com/docker/example-voting-app • https://github.com/joerter/gif-roulette • https://github.com/joerter/docker-chat • Docker in development • https://medium.com/iron-io-blog/why-and-how-to-use-docker-for-development- a156c1de3b24#.blx4d4j1k • https://www.smashingmagazine.com/2016/04/stop-installing-your-webdev-environment-locally- with-docker/ • Docker + ASP.NET Core • http://wildermuth.com/2016/03/28/Docker_and_ASP_NET_Core_A_Webcast • Docker + Node • http://jdlm.info/articles/2016/03/06/lessons-building-node-app-docker.html • Orchestration • https://docs.docker.com/swarm/ • http://kubernetes.io/