Workflow for developing Docker container-based applications This section describes the
inner-loop development workflow for Docker container-based applications.
The inner-
loop workflow means it’s not considering the bro
ader DevOps workflow, which can include
up to production deployment, and just focuses on the development work done on the developer’s
computer. The initial steps to set up the environment aren’t included, since those steps are done only
once.
74
CHAPTER 4 | Development process for Docker-based applications
An application is composed of your own services plus additional libraries (dependencies). The
following are the basic steps you usually take when building a Docker application, as illustrated in
Figure 5-1.
Figure 5-1. Step-by-step workflow for developing Docker containerized apps In this section, this whole process is detailed and every major step is explained by focusing on a Visual
Studio environment.
When you’re using an editor/CLI development approach (for example, Visual Studio Code plus Docker
CLI on macOS or W
indows), you need to know every step, generally in more detail than if you’re using
Visual Studio. For more information about working in a CLI environment, see the e-book
Containerized Docker Application lifecycle with Microsoft Platforms and Tools
.
When you’re using Visual Studio 2022, many of those steps are handled for you, which dramatically
improves your productivity. This is especially true when you’re using Visua
l Studio 2022 and targeting
multi-container applications. For instance, with just one mouse click, Visual Studio adds the
Dockerfile
and
docker-compose.yml
file to your projects with the configuration for your application.
When you run the application in Visual Studio, it builds the Docker image and runs the multi-
container application directly in Docker; it even allows you to debug several containers at once. These
features will boost your development speed.
However, just because Visual Studio makes those
steps automatic doesn’t mean that you don’t need
to know what’s going on underneath with Docker. Therefore, the following guidance details every
step.
75
CHAPTER 4 | Development process for Docker-based applications