How to dockerize your Spring Boot API | Docker Tutorial

preview_player
Показать описание
A few weeks ago I created a video showcasing how we can set up a simple Spring Boot REST API, I now wanted to showcase how we can move this API into a Docker container and then run it.

IMPORTANT: OpenJDK is now deprecated and we should use "eclipse-temurin:17" instead. OpenJDK will still work but is not getting any new updates.

Note that the second line in the Dockerfile does not have any effect in this example; it merely searches for any JAR file, which can then be utilized, as the third line copies the JAR_FILE instead of directly placing the file.

My channel publishes programming and software engineering videos, especially Java and Python. If that is what you want, do not hesitate to join me on this journey!

Subscribe to my YouTube channel:
Рекомендации по теме
Комментарии
Автор

The video is nice but what impressed me even more is how you try to help almost everyone in the comments. You take time to answer everyone! Probs to you!

cedescc
Автор

I have finally found the video how to make docker images with Java on Youtube :). Thanks, for great work and clear explanation. !!!

PacFearless
Автор

awesome content !! thank you very much !!!

abastecedorademateriales
Автор

thanks hey i was able to spin up my small spring project to a docker image...be blessed❤...

theparten
Автор

Short and clean, thanks you earned and subscriber... I hope I will learn a lot from this channel, I like we you explain even the -d that amazing thanks

andilesimelane
Автор

maaaan this is a good guide. Nice work man

szymaniuk
Автор

Appreciate the simple explanation.
Hope you make some more videos on Kafka end-to-end videos😅

Context: Struggling with edl kafka changes in docker file.

ayushkumarsaksena
Автор

Short and helpful, Thanks for the video!

samorita
Автор

How to maven install using dockerfile?

friedec
Автор

is it running as production or dev? can i choose this option to make it running in production mode?

orphnsx
Автор

hi it didnt work for me for some reason cant connect them can you help me ?

ockbkrl
Автор

Hi! hopefully someone will answer, what if I am in production and does a lot of changes every other time, is there a way to auto reload without needing to mvn clean package and rebuilding in the docker?

NeoTechVision
Автор

and if my app have a database connection? how i introduce my database inside the container, because i can´t stablish the conection because that.(sorry for my english)

KlanBr
Автор

Good shit, why the 2nd line in dockerfile? You arent using it anywhere

Go_with-Christ
Автор

брат, от души, ты спас мое положение у меня через неделю защита дипломки

ffffff
Автор

Hi, when i open localhost:8000, nothing to show. But when i start application with Spring everythik work normal.Can help?

stoiandelev
Автор

IMHO, the better idea is using JRE such as eclipse-temurin:17-jre-alpine instead of full JDK, the second line is useless or should be fixed and , maybe, from a security prospective - execute app in container as non root.

viktormykhasko
Автор

Hello! First of all Congratulation for your video!!

Well i have a problem, when i docker running this, it gives me an error messages about communication problem between the application and the MySQL database server.

Well the main error seems to be a "Communications link failure" with a "Connection refused" exception. I can understand that docker cant access my database server for some reason!.


I checked my database and everything is alright. Can you understand, why this is happening ?

acethoughtless
Автор

PLEASE i need a use case of spring boot 3 with zipkin running inside containers

ismailforeveryone
Автор

But, when I have a hibernate crud app, it doesn't work, the error that the image can't connect to the jpa

mohammedislam