- Docker Desktop for Windows
- Windows Subsystem for Linux
- IntelliJIDEA Community Edition
Using Spring Iinitializer create the java spring boot project as shown in the below image.
If you want to use CLI to create your spring application instead of initializer website as shown at the beginning then, install SDKMAN as below.
curl -s "https://get.sdkman.io" | bash
source "~/.sdkman/bin/sdkman-init.sh"
sdk install springboot
spring init --dependencies=web java-docker --build=maven
cd java-docker/
sudo ./mvnw spring-boot:run
Now in the wsl
terminal, run the following commands
a. sudo apt-get update
b. sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release
sudo docker build --tag java-docker .
sudo docker run -d -p 8080:8080 java-docker
sudo docker compose build --no-cache java-docker
sudo docker compose up –d
Choose Run > Debug “Attach to Remote Program”
. Now make changes to the message in the REST api.
Then choose Build> Rebuild Module “idg-java-docker”