2.8 KiB
Introduction
This is a super simple API I created using Spring Boot/Gradle to showcase what a development workflow using Docker development containers looks like.
Once your editor or IDE finishes setting up this container, you can test out the API by navigating to localhost:8080/sum. You will need to provide two integer parameters and, as the endpoint name suggests, the API will return their sum.
Setup - VS Code
- Ensure you have the following extension installed:
ms-vscode-remote.remote-containers(copy-paste that into extension search).
- It should be sufficient to simply open this project in VS Code.
Setup - IntelliJ
- In the welcome screen, navigate to Remote Development > Dev Containers.
-
Click on "New Dev Container" and either
a. Paste the link to this repository
b. Go to the "From Local Project" tab and give IDEA the path to this project's
devcontainer.jsonfile.
Running the Application
To run the application, navigate to CalculatorApplication.java and click the run button in the top right, or go to the Spring Boot Dashboard and click the run button there.
Example Usage
will return 100 + 12 = 112.
About Docker Devlopment Containers
Dev containers will allow our team to maintain a consistent development environment across members and platforms. While this is nice, it comes at the cost of (slightly) higher CPU, memory, and disk usage.
Both VS Code and IntelliJ IDEA support dev containers, with the former having a much higher level of integration. If we as a team enforce VS Code usage, we will see a greater level of consistency, as we will be able to declare what extensions get installed and what settings get modified.
Important
Cross IDE development is definitely possible, since IDEA (Ultimate) already comes bundled with everything VS Code would require an extension for.
Disk Usage
In my testing, I've observed the following:
| VS Code | IDEA |
|---|---|
| ~600 MB | ~4 GB |
Warning
Please let me know if disk capacity is an issue for you and would make using a dev container not possible!
Learn More
This video series is extremely informational and better explains what dev containers are and how they can be beneficial: Beginner's Series to: Dev Containers
MS Learn also has a great module that relays the same information as the videos: Use a Docker container as a development environment with Visual Studio Code


