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

Docker Is the New Package Manager: Making Local Development a Breeze

Docker Is the New Package Manager: Making Local Development a Breeze

Not too long ago if you wanted a MySQL or Redis server for local development you would install one via your operating system's package manager. This posed a slew of challenges (if it was even there to begin with). To name a few: the version was most likely out of date or didn't match what you used in prod, there was probably a configuration error with a local config somewhere, separating data and instances from other projects was a headache.

The days of Googling an obscure error message after running brew install are behind us. Docker has entirely replaced local installs of dependency services for many developers and become a staple for building things. In this session we'll take a look at how you can make your life easier by accepting Docker as your lord and package manager. You'll leave knowing everything you need to use Docker for local development and how you can ensure you're as close to production as possible.

Eddie Zaneski

August 08, 2019
Tweet

More Decks by Eddie Zaneski

Other Decks in Technology

Transcript

  1. digitalocean.com –Wikipedia “A package manager … is a collection of

    software tools that automates the process of installing, upgrading, configuring, and removing computer programs for a computer's operating system in a consistent manner.”
  2. digitalocean.com History of package managers • Source / tarball from

    FTP / mailing lists ◦ ./configure ◦ make ◦ sudo make install • .deb or .rpm ◦ YUP → YUM → DNF ◦ dpkg → (deity) dselect → APT ( 21 years old!) https://opensource.com/article/18/7/evolution-package-managers
  3. digitalocean.com Examples of modern package managers • Windows - Chocolatey,

    Scoop ◦ "The sane way to manage software on Windows" • Windows Update • APT - Debian • Homebrew - macOS (+ Linux) • npm - Node.js • NuGet - .NET • pip - Python • Google Play - Android
  4. digitalocean.com Package Managers in Summary • Take many forms •

    Get the software you need and their dependencies
  5. digitalocean.com –Docker "A container is a standard unit of software

    that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another." https://www.docker.com/resources/what-container
  6. digitalocean.com Docker Network and Links • Used to connect multiple

    containers together • Service discovery and DNS magic • (Don't use links)
  7. digitalocean.com Docker Volumes • Used for persistent storage amongst containers

    • Can share volumes between containers • Absolute path vs named volume • Useful for dev and prod • Don't run databases in Docker—use a managed service!
  8. digitalocean.com Bonus • Multiple versions • Easy clean up •

    Disposable • Build/compile inside a container • Open source Dockerfiles
  9. digitalocean.com Gotchas • Files created in the container are root

    (uid: 0, gid: 0) ◦ chown -R ◦ -u 1000:1000 (your UID, GID) • Bind to 0.0.0.0 • Read the README's for Docker Hub images ◦ Lots of environment variable options • Container sizes are hard to get right • "Best practices" • Stateful • RTFM