The application development life cycle starts at your computer, as a developer, where you code the application using your preferred language and test it locally. With this workflow, no matter which language, framework, and platform you choose, you're always developing and testing Docker containers, but doing so locally.
Each container (an instance of a Docker image) includes the following components:
-
An operating system selection, for example, a Linux distribution, Windows Nano Server, or Windows Server Core.
-
Files added during development, for example, source code and application binaries.
-
Configuration information, such as environment settings and dependencies.
This section describes the inner-loop development workflow for Docker container-based applications. The inner-loop workflow means it's not considering the broader 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.
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 1.
Figure 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 Windows), 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 Visual 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.
Proceed to the next exercise to start working with containers.
-
Get started with Docker Desktop for Windows
https://docs.docker.com/docker-for-windows/ -
Visual Studio 2022
https://visualstudio.microsoft.com/downloads/
