You Don't Need to Rebuild Your Development Docker Image on Every Code Change

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • skaffold

    Easy and Repeatable Kubernetes Development

    Skaffold is a great tool for this and employs hot reloading techniques without having to rebuild the image. https://skaffold.dev/

  • bazel_compose

    Bazel wrapper for docker-compose

    While this is great for people with a fundamental understanding of containers and your prod environment this will usually lead to some issues with developers that don't need to, or want to, have context in these areas.

    In the past, to make a very similar workflow possible, I've built tools that automatically watch your source files and rebuild & restart only what is needed [0]. This was built for bazel + docker-compose but there isn't a reason one couldn't watch the "build:" contexts for what files are important.

    At a previous company one of our engineers was a huge fan of this volume mount approach and every single time something broke (which was very frequent due to some prod/dev env magic we had) I had to assist quite a few more junior devs figure out what was wrong with their machine. For those with scripting languages, was it their system's newline endings? For compiled languages, was their system SDK different then what was in the container? For prod bugs, did they forget to rebuild & test the container before opening their PR (we had no automated integration testing)?

    In my opinion, if you can make your build system in charge of building/packaging things you'll have a much happier time.

    [0] - https://github.com/CaperAi/bazel_compose

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

  • Docker Compose

    Define and run multi-container applications with Docker

  • telepresence

    Local development against a remote Kubernetes or OpenShift cluster

    some alternative tool, that enables similar workflow, but via other means:

    https://www.telepresence.io/

  • entr

    Run arbitrary commands when files change

  • garden

    Automation for Kubernetes development and testing. Spin up production-like environments for development, testing, and CI on demand. Use the same configuration and workflows at every step of the process. Speed up your builds and test runs via shared result caching

    Garden[0] is tool we built (yes, I'm affiliated :)) that has a lot of this functionality built-in. Might fit your use case.

    We recently re-wrote the hot reload functionality to use Mutagen[1] under the hood and its insanely fast (<200ms anecdotally). It also does two way sync which can be useful. The old implementation used rsync but a lot of our Windows users struggled with that. So I figured I'd share in case that sounds familiar.

    What happens after a sync event depends on the stack, but we've had pretty good success with Entr[3]. We often have it watch a single file so that multiple watchers in a shared dev cluster don't eat up all the node's resources.

    1: https://github.com/garden-io/garden

  • dew

    Run everything in (Docker) containers

    In the past few weeks, I have spent some time and released dew [0]. It helps encapsulating this kind of setups in configuration and minimising typing. dew is still evolving, but it has served me well.

    [0]: https://github.com/efrecon/dew

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

  • volta

    Volta: JS Toolchains as Code. ⚡

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts