-
Search
spring
in extension, download top 4 extensions. -
Search
java
in extension tab, download the first extension by Microsoft.
- Refer video here: https://www.youtube.com/watch?v=2qbf4Duqncw
- Refer video here: https://www.youtube.com/watch?v=3SNKdr3f9Io
curl localhost:8000/api/hw output: Hello World
- Creating
jar
file intarget
folder
mvn clean package
- Running jar file
java -jar hw-0.0.0.1-SNAPSHOT.jar
- Running docker container at port 8000 with springboot application port as 8080
docker run -p 8000:8080 springapi # 8080 (Springboot applicaiton port), forwarding it to 8000 (docker port)
- Running the container in dormant mode (-d) - (No prompt will be shown, container will be runnign silently)
docker run -d -p 8000:8080 springapi
- Removing docker container with particular sha
docker rm -f 783f7fb3c2c5
- See running docker containers
docker container ls
- Checking docker images
docker images
- Checking if container is running
docker ps -a # -a shows dormat containers as well
- Starting docker container
docker start da98
- Stoping docker container
docker stop da98 # docker stop sha-value
- Checking logs of Docker container since creation
docker logs -f da98 # docker logs -f sha-value
- Executing docker in interactive mode
docker exec -it da98 sh
OR
docker exec -it da98 bash
- git init
- git add .
- git commit -m "Add changes"
- git remote add origin https://github.com/afrozchakure/Springboot-Docker.git
- git push -u origin main