Spring boot build docker image | Spring profiles, Runtime environment variables
ฝัง
- เผยแพร่เมื่อ 17 ก.ย. 2022
- Learn how to create a docker image for your spring boot app, use multiple spring profiles and pass runtime environment variables to the spring app.
Source code: github.com/maxim04/video-4-sp...
I will definitely watch this video when I finish my app! Highly interested ✌
Hope you like it!
Thanks alot! Do you think using this tags will help if I have to services each with their own application properties? And I will want service1 and service2 to kind of inherit from an application.properties. I will wish that each service loads its own appliation.properties file independently. The video quality if blurred. Not sure why.
What you can do is create additional profiles: service1, service2. This will allow you to have specific application.properties files for each profile e.g. application-service1.properties. Then you can activate multiple profiles: prod, service1. This way it will load the following files: application.properties, application-prod.proprties, application-service1.properties. You can do the same for the second service.
@@codingwmax Thanks alot! I will try that because my ultimate goal is to dockerize them when I finish. U really helped me this video,.
@@codingwmax Already tried but it seems to load just 1 profile service1. When I defined 2 ports and tried to run the services, service2 tells me the port is already in use. It means the application-service2.properties do not seem to run via its own port! So maybe this method works only if we are using several properties files in a single spring boot application, since in that case, we only need 1 port!
Hi,
All worked but a facing a problem while building it, Getting "Builder lifecycle 'creator' failed with status code 51". in details, its not able to load the creator, , Stuck here!! Can you help here
Hi, I remember I faced similar problems one time and it turned out the website to download dependencies was down. Are you still facing this issue?
@@codingwmax no it didn’t work, so switched to old procedure jar with dockerfile, 😅😅
Thanks for the information though