

This may mean a simple recompile of the application binary and we are off to the races. Often this is satisfactory, especially when working with compiled languages, as Docker will cache unchanged parts of an image and rebuild only those that have changed.

So what happens when you make a change to your code? In order to see that change, you need to rebuild your image and start a new container.

When developing in Docker, there are a couple of steps that need to take place in order to get an application running: While there are many more reasons to use Docker, especially in production, these are a few of the benefits you can gain from using it for development, even if its use stops there! So What’s the Problem? If you are deploying an image to production, you are also getting a development environment that more closely resembles that of production-reducing the issue of “it works on my machine!”. This includes the OS, database, language version, and libraries. Docker helps ensure that each developer is running the application with the same version of dependencies and tools.Due to the nature of containers, Docker solves this problem for free. When working on a number of projects with conflicting dependencies, it can be difficult and error-prone to isolate one from another.The act of declaring a Dockerfile or Docker Compose file makes it explicit exactly what dependencies are required for the app to run and how they are wired up.With Docker and the help of Docker Compose, this can be reduced to a single step. Setting up a new project can involve a number of steps.Before we begin, let’s remind ourselves of a few reasons why we might be developing in Docker: Developing in Dockerĭeveloping in Docker has a number of advantages over developing directly on your Mac. In this post we are going to explore a common pitfall related to developing an application in Docker on the Mac and see what we can do to mitigate the issue and work as productively as possible. It can simplify both the development of an application as well as deployment and management of it. Docker is a helpful tool for both developers and ops.
