Development with Docker Engine and Compose

Zak B. Elep

Created: 2017-12-05 Tue 21:06

https://github.com/zakame/dscl-devday-docker-compose

About Me

  • @zakame on GitHub, Twitter, FB
  • Goon from the Philippine Linux Users Group
  • Co-organizer, Docker Manila Meetup group
  • Hacks on Perl, Docker, Emacs

What's this for?

  • Short intro on Docker
  • Assumes a developer audience (this is DSCL DevDay after all…)
  • Assumes some familiarity with server infra (for the ops people at the back…)

Why Docker?

  • Distribution
  • Maintenance
  • Development

The Problem

"How can I share my work with others while making it easy for them to change it?"

Distribution

  • Software systems as containers
  • (Mostly) standalone systems (especially for exotic setups)
  • (Mostly) less chance of incompatibilities/inconsistencies

Maintenance

  • Growing from "pet to cattle" setups
  • Reducing moving targets (e.g. external dependencies and/or hybrid OS requirements)
  • Redundancy (e.g. blue-green deployments)

Development

  • Builds up on distribution and maintenance merits
  • Correlate code history with system history (e.g. git vs docker commits)
  • Leverage other solutions (e.g. configuration management/deployment/orchestration tools)

Containers

Operating-system-level virtualization

community_JJgCnE6.png

Containers vs Virtual Machines

  • Operating-system-level vs hardware-abstraction-level
  • Containers can run under VMs (and often do,) but not usually the other way around
  • Containers depend on OS features (Linux)

Other Container implementations/tools

  • Linux Containers (LXC)
  • plain Unix chroot
  • FreeBSD jails
  • Solaris Zones

Docker Plaform

dockercon-eu-2017-recap-24-638.jpg

Docker Engine

  • The "heart" of the Docker ecosystem
  • Used to be just a big front-end for the Linux containers
  • Now uses libcontainer to front-end for implementations

Demo: A simple CLI app container

Docker Compose

  • Arrange containers into services
  • Express software systems in terms of services, networks, and volumes
  • Adapt systems to different environments (dev vs prod) via composition of configuration

Demo: A webapp with several services

More Information

Finis