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!
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.
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
You are right, in this case, it does not do anything. Normally we would use: ARG JAR_FILE=target/*.jar COPY ${JAR_FILE} app.jar To copy any jar file, but in this video, I wanted to clearly showcase which file we were actually moving, so it stayed, and I can hear I am more or less explaining what it does but it is clearly not used in the video.
I encounter this Error when tried to run docker image: " Caused by: org.postgresql.util.PSQLException: Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connection " Does anyone know the resolution to this error? Thank you so much!
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.
In this case, ADD and COPY would do more or less the same. The main difference is that ADD can retrieve remote URLs and extract compressed files, while COPY only copies local files from the Docker host.
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?
At scale, a pipeline is used for updates. Keywords to investigate are CI/CD: CI (Continuous Integration) automatically tests the system, and CD (Continuous Delivery) automatically deploys changes. This is a huge field with many tools and customizable options. Hope this answers your question, otherwise, let me know.
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 ?
It is difficult to pinpoint the exact reason why it is not working, but my initial suggestions would be to check if the Docker container is connecting to the correct port that the Spring Boot application is exposing. If everything appears to be correct, you can consider accessing the container manually to investigate the issue further form inside the container.
A jpa issue indicates your service cannot connect to your database. If your database is in another docker container they need to be on the same docker network, and the db needs an open port where the service can connect.
@@Randomcode_0 thanks bro for your response 🥰 , I'm new at both any toturiel will be good for me , I'm interested in your content, keep up the good work 😁
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)
Your database should either have a public IP that you can connect to, or it needs to be accessible on the same network. In a more real world setup, your container would run on a cloud network where they could communicate, if a public endpoint is not desired.
I have jsut been trying out zipkin, I now have a working system using docker-compose. Where I start a zipkin server in a contianer and a simple spring boot rest api in another container. Every call to the spring api is then called as a trace (but no saved in any database). I asssume this is more or less what you asked for? I will make vidoe showcaing and talking about this setup some time soon. Please let me know if this does not solve your use case.
@@Randomcode_0 thank you so much for your answer , the prob was latest versions of openzipkin have changed it's default port so the new endpoint to post zipkin trace is zipkin: tracing: endpoint:zipkin-server:9411/api/v2/spans , not zipkin-server:9411/ (which used with the oldest versions (this update made with spring boot 3
If you are running FROM a docker environment containing java it should no be a problem. When we use: ENTRYPOINT["java","-jar","/app.jar"] it is translated and run inside the docker container as: java -jar /app.jar Otherwise could you specify when you get this problem?
Useless. Your example is so superficial there is nothing to learn from it. At least show how to do it with spring boot maven plugin and build packs, or how to reduce the image size by running lite versions of your jre.
Dealing with dependencies would be useful info to cover too - my springboot app relies on some dependencies in my local .m2 maven repository, so crashes inside the container because the dependencies aren’t copied in. Trying to figure out the best way to do this.
@@abulka it's not your fault it's because the tutorial is trash. You need to use spring boot maven plugin with build packs. The command is build image. Look it up on Google
I recommend trying to build a fat JAR, which is a JAR file that includes dependencies bundled within it. While I can't guarantee it will solve your problem, it's a good starting point and the first thing I would test.
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!
Thank you, I have been a bit busy lately, but I am trying to once again get through most comments!
I was stuck on the problem where I was not able to create the docker file for my project. Your video resolved my problem so easily. Thank you so much!
I'm so glad the video helped you solve the issue with your Docker file, thanks for the kind words!
I have finally found the video how to make docker images with Java on TH-cam :). Thanks, for great work and clear explanation. !!!
Literally saved my life Thank you!
Great to hear!
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.
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
Awesome, thank you!
thanks hey i was able to spin up my small spring project to a docker image...be blessed❤...
Glad it helped!
Good shit,why the 2nd line in dockerfile? You arent using it anywhere
You are right, in this case, it does not do anything. Normally we would use:
ARG JAR_FILE=target/*.jar
COPY ${JAR_FILE} app.jar
To copy any jar file, but in this video, I wanted to clearly showcase which file we were actually moving, so it stayed, and I can hear I am more or less explaining what it does but it is clearly not used in the video.
Goated tutorial
I encounter this Error when tried to run docker image:
" Caused by: org.postgresql.util.PSQLException: Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connection "
Does anyone know the resolution to this error? Thank you so much!
Flash bang 😂 with the postman
I am so sorry :)
maaaan this is a good guide. Nice work man
Glad you think so!
awesome content !! thank you very much !!!
Short and helpful, Thanks for the video!
You're welcome! I'm glad you found the video helpful.
But I don't have a jar file that is generated
you should execute 'mvn clean install' in your project terminal
What is the need for ARG JAR_FILE ?
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.
Nice content!
Glad you think so!
I think we can use either of ADD COPY
In this case, ADD and COPY would do more or less the same. The main difference is that ADD can retrieve remote URLs and extract compressed files, while COPY only copies local files from the Docker host.
Best video. thumbs up
Big thanks
The JAR line is unnecessary, you don't use it later.
is it running as production or dev? can i choose this option to make it running in production mode?
hi it didnt work for me for some reason cant connect them can you help me ?
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?
At scale, a pipeline is used for updates. Keywords to investigate are CI/CD: CI (Continuous Integration) automatically tests the system, and CD (Continuous Delivery) automatically deploys changes. This is a huge field with many tools and customizable options. Hope this answers your question, otherwise, let me know.
finally, thanks man
Happy to help
How to maven install using dockerfile?
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 ?
Hello there, did you manage to solve the issue ?
i face the same problem. Did u manage to solve this issue?
Hi, when i open localhost:8000, nothing to show. But when i start application with Spring everythik work normal.Can help?
It is difficult to pinpoint the exact reason why it is not working, but my initial suggestions would be to check if the Docker container is connecting to the correct port that the Spring Boot application is exposing. If everything appears to be correct, you can consider accessing the container manually to investigate the issue further form inside the container.
But , when I have a hibernate crud app , it doesn't work , the error that the image can't connect to the jpa
A jpa issue indicates your service cannot connect to your database. If your database is in another docker container they need to be on the same docker network, and the db needs an open port where the service can connect.
@@Randomcode_0 can u please do a toturiel about it!
I think that's a great idea! Which database are you using? Would you prefer a pure Docker setup or docker-compose?
@@Randomcode_0 thanks bro for your response 🥰 , I'm new at both any toturiel will be good for me , I'm interested in your content, keep up the good work 😁
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)
Your database should either have a public IP that you can connect to, or it needs to be accessible on the same network. In a more real world setup, your container would run on a cloud network where they could communicate, if a public endpoint is not desired.
Thank you so much
You're most welcome
ERROR: failed to solve: dockerfile parse error on line 5: unknown instruction: ENTRYPOINT["java",
used CMD, removed brackets and quotes. It worked
Glad to hear you got it working.
брат, от души, ты спас мое положение у меня через неделю защита дипломки
It works ! Ty
PLEASE i need a use case of spring boot 3 with zipkin running inside containers
I have jsut been trying out zipkin, I now have a working system using docker-compose. Where I start a zipkin server in a contianer and a simple spring boot rest api in another container. Every call to the spring api is then called as a trace (but no saved in any database). I asssume this is more or less what you asked for? I will make vidoe showcaing and talking about this setup some time soon. Please let me know if this does not solve your use case.
@@Randomcode_0 thank you so much for your answer , the prob was latest versions of openzipkin have changed it's default port so the new endpoint to post zipkin trace is zipkin:
tracing:
endpoint:zipkin-server:9411/api/v2/spans , not zipkin-server:9411/ (which used with the oldest versions (this update made with spring boot 3
I am glad to hear you got it working!
@@Randomcode_0 thank you so much dear coder , that's very kind of you
Thanks a lot!
No worries!
Thank you😊
You're welcome 😊
Isn't openjdk deprecated?
You seem to be right, I did not know that. It seems like we should use: "eclipse-temurin:17" instead. Thanks for letting me know
It says [java, : notfound
If you are running FROM a docker environment containing java it should no be a problem. When we use: ENTRYPOINT["java","-jar","/app.jar"] it is translated and run inside the docker container as: java -jar /app.jar
Otherwise could you specify when you get this problem?
Thanks
Thx
ADAMSIN
Useless. Your example is so superficial there is nothing to learn from it. At least show how to do it with spring boot maven plugin and build packs, or how to reduce the image size by running lite versions of your jre.
Dealing with dependencies would be useful info to cover too - my springboot app relies on some dependencies in my local .m2 maven repository, so crashes inside the container because the dependencies aren’t copied in. Trying to figure out the best way to do this.
@@abulka it's not your fault it's because the tutorial is trash. You need to use spring boot maven plugin with build packs. The command is build image. Look it up on Google
I recommend trying to build a fat JAR, which is a JAR file that includes dependencies bundled within it. While I can't guarantee it will solve your problem, it's a good starting point and the first thing I would test.