Тёмный

Docker spring boot MySQL example | Spring boot MySQL docker 

Coding Boot
Подписаться 1,8 тыс.
Просмотров 46 тыс.
50% 1

Опубликовано:

 

11 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 130   
@prasadhonrao
@prasadhonrao Год назад
After spending entire day debugging the communication failure issue between two containers, I learnt that I need to setup the network between the two containers and set the right port. Your video was spot on. A big thank you!
@أحمدعلاء-ن7د
@أحمدعلاء-ن7د Год назад
believe me .. if everyone explains the topics like you .. we will be in a great world..
@ochy
@ochy 2 года назад
You have summarize docker in a beautiful way. What could have taken a number of lectures to teach has taken you just 37:12 minutes. Kudos!
@codingboot455
@codingboot455 2 года назад
Thank you 😊
@nischalbhatt5969
@nischalbhatt5969 Год назад
Very very helpful
@nischalbhatt5969
@nischalbhatt5969 Год назад
Extremely helpful for someone like me who comes from an on prem environment and who is so new to docker and the world of microservices
@mahmoudyacine9886
@mahmoudyacine9886 2 года назад
best video I have ever seen about java app on docker, also this is the first video I saw explains networks in meaningful way.
@codingboot455
@codingboot455 2 года назад
Thank you 😊
@anirbandas9333
@anirbandas9333 2 года назад
It’s a great tutorial for java developers who want to learn docker from the basics. It was really helpful
@codingboot455
@codingboot455 2 года назад
Thank you
@sagarmelmatti
@sagarmelmatti 2 года назад
Finally I was able to run my spring boot mysql application with Docker ,Thanks a lot
@codingboot455
@codingboot455 2 года назад
Thank you
@rahulkumar-jw1by
@rahulkumar-jw1by 3 года назад
This explanation is awesome I was stuck in one issue for one day when I saw this video and concept it got resolved in 15 min
@codingboot455
@codingboot455 3 года назад
Thank you, what was the issue?
@rahulkumar-jw1by
@rahulkumar-jw1by 3 года назад
@@codingboot455 I was doing port forwarding to 3308 which is for public access and that port I am giving in applications.properties so I am able to connect from my local but when I was creating container of my application that time also I was giving port as 3308 which was wrong instead of that we have to give 3306
@shubhamtopare9720
@shubhamtopare9720 2 года назад
@@rahulkumar-jw1by Thank you man your comment helped, I was also facing the same issue. As both starts with 330 it makes confusion.
@ragavanravi8801
@ragavanravi8801 2 года назад
truly amazed on how precise the content was explained
@codingboot455
@codingboot455 2 года назад
Thank you
@vigneshgvs
@vigneshgvs 2 года назад
only u told - docker containers should be run in backend... i was running foreground and it was exiting at once, thank god, i saw your video....
@biswash-giri
@biswash-giri 2 года назад
simplified everything in a single video thanks
@ktn4
@ktn4 3 года назад
Thanks for this great tut man, I was stuck while trying to run the app but this video got me through. Hope you will make another docker tut with docker compose 🥺
@codingboot455
@codingboot455 3 года назад
Thank you ☺️, sure I will create on docker-compose
@jasper5016
@jasper5016 2 года назад
Brother, this is the fantastic video. This is the only video that worked for me. It look a long but worked. Do you have any videos on Kubernetes as well?
@davidflbdv2742
@davidflbdv2742 3 года назад
U ARE BEST!!!!!!!!!!!!!!!!!!! ALL GUIDES didn't help me( but now all are working
@codingboot455
@codingboot455 3 года назад
Thank you ☺️
@swe4chaewon
@swe4chaewon Год назад
this tutorial saved my life
@skkar2k2
@skkar2k2 2 года назад
Very Nicely explained... Also adding docker-composer for this example is also helpful.
@codingboot455
@codingboot455 2 года назад
Thank you , another video on docker-composer ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE--ekBqIvAGY4.html
@calintamas7576
@calintamas7576 2 года назад
Excelenteeeee! Thx! Finally I've succeeded to start my springboot app in Docker!
@codingboot455
@codingboot455 2 года назад
Thank you 😊
@anandyadav-kx1ju
@anandyadav-kx1ju 3 года назад
You explained every point very precisely, thanks for making this lab.
@codingboot455
@codingboot455 3 года назад
Thank you ☺️
@shaktigoyal6713
@shaktigoyal6713 Год назад
great video for beginners .. thanks a lot for sharing..
@nagarajkharvi9081
@nagarajkharvi9081 3 года назад
Wow man great explaination. Wanted this info badly
@jamescameron8140
@jamescameron8140 2 года назад
Thanks, I spent alomost two days trying to find out how to connect MySQL to Spring Boot app inside Docker. I finally made it work because of your video. Could you please also provide Docker-compose file for this project if possible? Cheers.
@codingboot455
@codingboot455 2 года назад
Thank you 🙂, sure I will upload docker-compose soon
@arjunvetal2274
@arjunvetal2274 Год назад
its really helpful to me and its great tutorial the way u explaining
@codingboot455
@codingboot455 Год назад
Thanks Arjun
@mks5988
@mks5988 3 года назад
Exactly what im looking.prescise explanation .Thank you
@codingboot455
@codingboot455 3 года назад
Thank you ☺️
@funnyprogrammer4056
@funnyprogrammer4056 Год назад
Thanks for this video .If you create a video for kubernetes from scratch and like this type of example that will be very beautiful.Thanks
@codingboot455
@codingboot455 Год назад
Thanks 😊, k8s noted for future video.
@Александр-ж9ш4р
@Александр-ж9ш4р 6 месяцев назад
Thank you. It is really very helpful.
@bharathkalyans
@bharathkalyans Год назад
Nice explanation!!!
@codingboot455
@codingboot455 Год назад
Thank you 😊
@anubhavnigam7611
@anubhavnigam7611 Год назад
I have a small question can the spring boot container establish the connection with MySQL container not by using container name and port 3306 (internal to MySQL container) but using localhost and 3307 port (the exposed one by MySQL) like we have established for dbeaver?
@codingboot455
@codingboot455 Год назад
If you want to connect host machine MySQL from container for testing purpose then you can attach host network to spring boot app container as --network=host then localhost will point to host machine ( not recommended). Or you can use host machine IP address but make sure your host machine MySQL is configured to connect through IP address.
@anubhavnigam7611
@anubhavnigam7611 Год назад
​@@codingboot455 Actually I meant to say that when 2 containers want to interact with each other hosted on the same machine they cannot interact using localhost ,they can interact using internal ports and container names only ??
@codingboot455
@codingboot455 Год назад
A container is just like a virtual machine and it has its own isolated network. Localhost refers the container itself
@elkylotv2927
@elkylotv2927 Год назад
My God, you have no idea how hard I've struggled to get my spring project running in a vm. Seriously, thank you very much for such a great video. I would like to ask a couple of additional questions. I have downloaded a virtual machine to be able to do all this and only as a practice, but in reality what I need is to hire a VPS service from a company (like hostinger, for example), and I would perform all these steps again. But how could I associate the IP provided by the company? So it is the web open to any user. And my other question is, how could I do this to connect it with an Angular project?Because I have developed a website where the Front is made with Angular and the back with Spring. Again seriously thank you very much for this video. Greetings from Argentina!!!
@codingboot455
@codingboot455 Год назад
I'm glad to help 🙂. After creating container you can map external port and ip address to your domain. Then access app from anywhere Ex: Using ip- YOUR-SERVER-IP:8080/springapp Using domain - your-domain/springapp Docker compose make more easy containerisation. Please follow this video : ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE--ekBqIvAGY4.html Thanks
@TreeThailand
@TreeThailand 3 года назад
Nice and Good video thank you
@codingboot455
@codingboot455 2 года назад
Thank you
@LimeInFrance
@LimeInFrance 2 года назад
Thanks a lot, really solved my problem
@devendrarahangdale5857
@devendrarahangdale5857 2 года назад
Very nice explanation please create more videos
@ErfanAhmed
@ErfanAhmed 2 года назад
precise tutorial! really appreciate it! thanks!
@codingboot455
@codingboot455 2 года назад
Thank you
@moeal5110
@moeal5110 2 года назад
A great guide for starting with Docker, thanks a lot. What ubuntu flavor are you using and version?
@codingboot455
@codingboot455 Год назад
Thank you :) , Im using ubuntu
@suryajit7
@suryajit7 2 года назад
good video
@parth-shah
@parth-shah 2 года назад
Very well explained.
@codingboot455
@codingboot455 2 года назад
Thanks
@sushmithac3592
@sushmithac3592 2 года назад
Very good explanation. I followed the vedio but I have got an error, so my question is what is mysqlenv file contains?
@codingboot455
@codingboot455 2 года назад
mysqlenv file contaons environment variables
@sushmithac3592
@sushmithac3592 2 года назад
@@codingboot455 thank you for your fast reply. Yeah, I created Env file which contains host, user , password and port. I run the Docker network command it's running fine in 9090. Which I same used as spring-net. When I am trying to do volume concept when I run docker run -d -p 3307:3306 --net spring-net -- name mysqldb - env-file myenv mysql. Showing error: Error response from deamon: pull access denied for myenv, repository doesn't exist or may require docker login
@codingboot455
@codingboot455 2 года назад
@@sushmithac3592 yes may be dont have permission in specified directory
@codingboot455
@codingboot455 2 года назад
run d -p 3307:3306 --net spring-net - name mysqldb - env-file myenv mysq, here missing -d
@codingboot455
@codingboot455 2 года назад
run d -p 3307:3306 --net spring-net - name mysqldb - env-file myenv mysq, here missing -d
@JasonBourne787
@JasonBourne787 2 года назад
@Coding Boot - I need to connect to mysql server whicgh is not containerized e.g one running on my localhosy at 3306 as a standalone any advise ?.
@codingboot455
@codingboot455 2 года назад
Yes, i have showed in this video
@daccu8633
@daccu8633 2 года назад
very nice job, brother. thanks a lot for the time and effort you have spent on this video to help me and others. deeply appreciate it. love to see more tutorial videos like this in the future.
@codingboot455
@codingboot455 2 года назад
Thank you so much brother 😊
@thepinkskyrider3069
@thepinkskyrider3069 Год назад
my container is running but I am not able to connect it with dbeaver like u did
@manikandanmanikandan-hp9td
@manikandanmanikandan-hp9td Год назад
Thanks bro✌✌
@anubhavnigam7611
@anubhavnigam7611 3 года назад
Just a small question while running the spring boot application locally without creating the container, can I establish the connection directly with MySQL container with the exposed port 3307 in localhost. Basically can I by pass the sql connection created locally using Dbeaver community with container .I instead connect directly by passing localhost and port 3307 in yml file with MySQL container ?
@codingboot455
@codingboot455 3 года назад
If you want to connect MySQL Container from spring boot application running in eclipse(without container ) you can use localhost: as we are able to connect through Dbeaver . Just let me know if you have any other question or still have doubt .
@anubhavnigam7611
@anubhavnigam7611 3 года назад
@@codingboot455 mysql-docker-port means the port exposed by MySQL container on localhost ie 3307 instead of 3306 because 3306 is internal to container.I am saying 3307 specific to this video not in general
@codingboot455
@codingboot455 3 года назад
@@anubhavnigam7611 Very good question . Yes 3307(exposed port) not 3306. If you want to connect internal port then you need to attached HOST network to the container (which is not recommended ). docker run --net host jenkins/jenkins in the above example, you can access it from internal port 8080 because it is connected to the host machine network (but here Jenkins is able to access your host machine network which is not recommended)
@bgproductionsmedia4168
@bgproductionsmedia4168 2 года назад
I am unable to connect to the database using dbeaver
@vinodbhargavARCOT
@vinodbhargavARCOT 3 года назад
Hi, at 13:00 can we change JDBC URL (replacing localhost with docker container name), username, password manually in the application.yml file as I am doing it in an ec2 machine. Please help I am unable to build a jar file after replacing localhost with container name.
@codingboot455
@codingboot455 3 года назад
Are you connecting to database docker container?
@codingboot455
@codingboot455 3 года назад
If you add localhost it will try connect EC2 host db . You can also use env file and keep db credential/runtime args in env file 27:00
@vinodbhargavARCOT
@vinodbhargavARCOT 3 года назад
@@codingboot455 Thanks for reply, my exact query is I cloned my spring boot project from my github & can able to build it while connecting it to mysql in my localhost. But when i started using mysql as container, i am unable to connect application to container (@ 13:00 You passed VM Arguments in an editor. Where exactly i should pass these arguments as i am not using any editor in ec2 machine). Thats my query
@codingboot455
@codingboot455 3 года назад
You can create env file in local machine and upload on server , specify same location while creating spring app container
@susmitachougule3833
@susmitachougule3833 2 года назад
@@codingboot455 hello sir
@ichikiaseru6616
@ichikiaseru6616 2 года назад
Good night... Ha Ha. It's programming I love this.
@codingboot455
@codingboot455 2 года назад
Thank you
@meenakshibadiger2058
@meenakshibadiger2058 Год назад
hello sir how we need use mount bind in docker-compose file
@codingboot455
@codingboot455 Год назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE--ekBqIvAGY4.html
@shobinb4493
@shobinb4493 2 года назад
I am facing an issue. I have created one c# console application to fetch data from mysql database. I have created one container for my application and another container for mysql database. I have followed the same steps of yours. But getting an issue on last step, Unhandled exception. MySql.Data.MySqlClient.MySqlException : Unable to connect to any of the specified MySQL hosts.
@codingboot455
@codingboot455 2 года назад
Have you created network and attached to both containers ? Please share command for both containers
@pixo-pixel
@pixo-pixel 2 года назад
please make docker compose as soon as possible
@codingboot455
@codingboot455 2 года назад
Sure I will upload soon
@jaquelinedb5082
@jaquelinedb5082 2 года назад
Genial :3
@shammaalb3493
@shammaalb3493 2 года назад
I am having an issue with the connection with mysql :( can you please help
@codingboot455
@codingboot455 2 года назад
What issue getting?
@shammaalb3493
@shammaalb3493 2 года назад
@@codingboot455 MYSQL connection error in the last step, even though i did the same steps as you did , not sure what is the issue
@codingboot455
@codingboot455 2 года назад
Make sure you have connected the same network to both container. And what error getting can you add here
@shammaalb3493
@shammaalb3493 2 года назад
@@codingboot455 It is connected. The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_212] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_212] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_212] at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_212] at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61) ~[mysql-connector-java-8.0.28.jar!/:8.0.28] at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105) ~[mysql-connector-java-8.0.28.jar!/:8.0.28] at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151) ~[mysql-connector-java-8.0.28.jar!/:8.0.28] at com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:167) ~[mysql-connector-java-8.0.28.jar!/:8.0.28] at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:89) ~[mysql-connector-java-8.0.28.jar!/:8.0.28] at com.mysql.cj.NativeSession.connect(NativeSession.java:120) ~[mysql-connector-java-8.0.28.jar!/:8.0.28] at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:843) ~[mysql-connector-java-8.0.28.jar!/:8.0.28] ... 58 common frames omitted Caused by: java.net.ConnectException: Connection refused (Connection refused) at java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:1.8.0_212] at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) ~[na:1.8.0_212] at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) ~[na:1.8.0_212] at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) ~[na:1.8.0_212] at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:1.8.0_212] at java.net.Socket.connect(Socket.java:589) ~[na:1.8.0_212] at com.mysql.cj.protocol.StandardSocketFactory.connect(StandardSocketFactory.java:156) ~[mysql-connector-java-8.0.28.jar!/:8.0.28] at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:63) ~[mysql-connector-java-8.0.28.jar!/:8.0.28]
@habibaezzagrani2326
@habibaezzagrani2326 2 года назад
Error: Unable to access jarfile app.jar , can u help ?
@codingboot455
@codingboot455 2 года назад
Yes sure
@codingboot455
@codingboot455 2 года назад
When you are getting this issue ?
@habibaezzagrani2326
@habibaezzagrani2326 2 года назад
@@codingboot455 while trying to run it with docker run command , before the connection with the network
@codingboot455
@codingboot455 2 года назад
Can you please paste your docker image build comand? Did you clean and build your project? Did you run docker build command in target folder ?
@codingboot455
@codingboot455 2 года назад
@@habibaezzagrani2326 If still facing this issue lets connect us05web.zoom.us/j/89155960269?pwd=dDMzUCtMckVJTUZQNVVLckN0ZDFjdz09
@grmatos24
@grmatos24 2 года назад
hello. how can i add jasper reports dependencies to openjdk docker images ?
@codingboot455
@codingboot455 2 года назад
We generally add in main application as dependency. Like you can add in spring boot app pom.xml, and you can deploy in docker.
@vishwavishwa8036
@vishwavishwa8036 2 года назад
Do u have the docker images of both containers?
@codingboot455
@codingboot455 2 года назад
Yes
@codingboot455
@codingboot455 2 года назад
Which both MySQL, and spring app?
@codingboot455
@codingboot455 2 года назад
Just run" docker pull mysql" for MySQL and spring project code git is added in description please clone and create images
@meriemramli5058
@meriemramli5058 2 года назад
where to create evn file, i created it on spring boot app but the app didnt want to run
@codingboot455
@codingboot455 2 года назад
You can create anywhere and provide the path
@meriemramli5058
@meriemramli5058 2 года назад
@@codingboot455 where i can provide the path , is it like --env-file ../home/env for exemple 2 - how i can provide the path if the env file is in the spring project
@codingboot455
@codingboot455 2 года назад
@@meriemramli5058 Even its in spring boot app just provide complete path. actually env file should be outsiide of app folder. or you can keep env file in current directory where running docker command
@meriemramli5058
@meriemramli5058 2 года назад
@@codingboot455 thank you
@wanderingsoul6675
@wanderingsoul6675 2 года назад
Hi @Coding Boot. Thanks so much for the tutorial and I followed your tuorial but still getting "com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server" .. :(
@codingboot455
@codingboot455 2 года назад
Are you using container name as host name and internal port number?
@wanderingsoul6675
@wanderingsoul6675 2 года назад
@@codingboot455 Hi. I was using local host as datasource url in my properties file. Once I replaced that with docker host, this issue was solved. Thanks for your reply.
@redfamilyvlog
@redfamilyvlog 2 года назад
I had similar issue when i tried with open jdk 11. Open jdk 8 worked for me
@give_me_my_nick_back
@give_me_my_nick_back Год назад
Connecting to mysql does not work, I get Public Key Retrieval is not allowed after an hour of trying I've given up and just replaced it with mariadb
@codingboot455
@codingboot455 Год назад
jdbc:mysql://localhost:3306/db?useSSL=false You can try useSSL= false for testing purpose
@give_me_my_nick_back
@give_me_my_nick_back Год назад
@@codingboot455 I mean simply replacing it with mariadb works and then it should be still compatible :D
Далее
GENIUS FOOD HACKS 🍰 #shorts
00:36
Просмотров 7 млн
NGINX Tutorial - What is Nginx
14:32
Просмотров 207 тыс.
Docker tutorial for beginners | [In 2 Hours]
1:50:11
Просмотров 32 тыс.
Learning Docker // Getting started!
35:56
Просмотров 110 тыс.
Ultimate Docker Compose Tutorial
1:03:14
Просмотров 188 тыс.