How to dockerize Springboot application using Docker Container

Veröffentlicht am: 15 Juli 2022
auf dem Kanal: Programming Tutorial
184
like

#dockerizespringbootapp #dockerizespringbootusingintellij #dockerizeapp #intellijidea #createdockerimagespringboot
How to dockerize Springboot application using Docker Container and intellij IDEA
Prerequisite
1. You have springboot application (download springboot app from my github = https://github.com/AminTurmudiYusup/s...)
2. docker already installed on your machine
3. Intellij Idea already installed(i using intellij idea community)
4. maven already installed on your machine
5. docker plugin already added into intellij idea



Follow this step to dockerize springboot app
1. Add springboot to intellij idea
2. build springboot app to jar(mvn clean install)
3. Create Docker file in root app and add this code
FROM openjdk:8-alpine3.9
ARG JAR_FILE=target/springbootstrap-0.0.1-SNAPSHOT.jar
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-jar","/app.jar"]
4. makesure your jdk version in DOcker file same with jdk version in POM.xml
5. Build springboot to Docker image
docker build -t apps/springboot:1.0 .
6. Run docker image inside container
docker run --name containername -p 8080:8080 -t apps/springboot:1.0
7. check Docker container IP
docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container_name

succeed
see you on the next tutorial !!!


Auf dieser Seite können Sie das Online-Video How to dockerize Springboot application using Docker Container mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Programming Tutorial 15 Juli 2022 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 184 Mal angesehen und es wurde von like den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!