Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@Commodore
- does not boot on k8s [it shouldn't]
- boots on idea [it shouldn't, bow I know why it does]
- boots on standalone docker [it shouldn't, no idea why it does] -
@netikras What the F?
why won't you do a 2 stage docker image build? sounds like it will solve most of these problems. -
@netikras
stage 1:
Start with a clean jdk image.
copy over code, and resources + lib jars.
build => compiled jar + manifest.mf in it.
stage 2:
start from a JRE, install your spring server, and spring libs.
copy over libs from stage 1.
copy over compiled jar from stage 1.
set the entrypoint.
use stage 2 in docker or k8s, and remove stage 1 image.
this will allow you to overcome the stale resources issue, as the build will always be clean.
## Learning k8s
Okay, seriously, wtf.. Docker container boots up just fine, but k8s startup from the same image -- fails. After deeper investigation (wasted a few hours and a LOT of patience on this) I've found that k8s is right.. I should not be working.
Apparently when you run an app in ide (IDEA) it creates the ./out/ directory where it stores all the compiled classes and resources. The thing is that if you change your resources in ./src/main/resources -- these changes do NOT reflect in ./out/. You can restart, clean your project -- doesn't matter. Only after you nuke the ./out and restart your app from IDE it will pick up your new resources.
WTF!!!
and THAT's why I was always under an impression that my app's module works well. But it doesn't, not by a tiny rat's ass!
Now the head-scratcher is WHY on Earth does Docker shows me what I want to see rather than acting responsibly and shoving that freaking error to my stdout...
Truth be told I was hoping it's k8s that's misbehaving. Oh well..
Time to get rid od legacy modes' support and jump on proper implementation! So much time wasted.. for nothing :(
random