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

Two years of Docker at realestate.com.au

Mike Williams
February 16, 2016

Two years of Docker at realestate.com.au

At REA, we've been experimenting with Docker since late 2013, and are now using it in production for many new services. Here I describe our gradual adoption of Docker over the past couple of years, lessons learned, and plans for the future.

Mike Williams

February 16, 2016
Tweet

More Decks by Mike Williams

Other Decks in Technology

Transcript

  1. compose-powered builds test: docker-compose run --rm dev bundle install docker-compose

    run --rm dev bundle exec rake dev: image: docker-registry.somewhere-at.rea/ubuntu-ruby2.2:v42 links: - db:db volumes: - .:/app - ruby2.2-gem-cache:/var/cache/gems/2.2.0 working_dir: /app db: image: docker-registry.somewhere-at.rea/mysql:5.6.29 Makefile docker-compose.yml
  2. Publishing images REPOSITORY = docker-registry.somewhere-at.rea/myteam/myapp VERSION := 1.0.$(shell date +'%s')

    default: image image: docker build -t $(REPOSITORY) . no_local_changes: git diff HEAD --exit-code release: no_local_changes image docker tag $(REPOSITORY):latest $(REPOSITORY):$(VERSION) docker push $(REPOSITORY):latest docker push $(REPOSITORY):$(VERSION) git tag $(VERSION) git push origin --tags Makefile
  3. Meanwhile … “harpoon” it’s like … docker run + docker

    build + make with YAML, and Python an opinionated Docker client
  4. lessons learned Build/test automation is a great place to start

    with Docker. Keep use-of-Docker for builds completely separate from use-of-Docker for packaging.
  5. John Fielder from SalesforceIQ in “Running Docker in Production Successfully”

    at DockerCon EU 2015 “Don’t go straight to a PaaS if you’re just starting out.”
  6. Shipper a simple launch vehicle for 12-factor Docker images “just

    enough half-assed PaaS on demand” <app/> configuration logs requests provides the perfect abstraction
  7. <app/> $CONFIG nginx log collector requests Splunk New Relic generic

    AMI supporting services your application docker-registry
  8. Shipper, it’s … generic Docker host AMI + some support

    images + curated CloudFormation template (template) + command-line interface … packaged as a Ruby gem (and a Docker image)
  9. Let me tell you a secret (We made secrets a

    container concern.) $KMS_ENCRYPTED_SECRET $SECRET shush application KMS
  10. Any web application any web-app framework any programming language any

    Linux variant Splunk support captures stdout/stderr no app support required New Relic support application monitoring system monitoring deployment notification CloudWatch support alerts you when service is down via email or web-hook Auto-scaling multiple servers load-balancing support for scaling schedules Zero-downtime deployments safe upgrades safe config changes
  11. Big wins Versioned “best practice”. Assuming nothing means it works

    in any REA account. Zero-downtime, auto-rollback. (In theory) packaged apps will port easily to clusters.
  12. lessons learned Docker is a great abstraction for processes. Single-Responsibility

    Principle applies. You don’t need a PaaS to be 12-factor.
  13. But wait … It’s 2016 already - where’s my damn

    hoverboard PaaS?! Deployment could be faster. Utilisation could be higher. What about batch jobs?
  14. Next steps More internal training. Introduce CaaS/PaaS infrastructure to support

    batch processing. Extend to support web-things and other long-lived workloads.
  15. JAN 2016 Teams experimenting with ECS and ECR Might this

    be our CaaS? Cache images in the target account? What goes on top? Replace our existing internal registry?
  16. NOV 2015 REA Group’s new internal v2 registry goes live

    authenticated, and available from anywhere* registry:2 nginx S3 bucket authentication was the hard bit
  17. Our Docker open source - an opinionated Docker client -

    internal training material - “bundle update” for Docker - it’s a secret