>>>>> Jean-Baptiste Onofre <[email protected]>:
> If Heroku is able to run Java, I don’t see why we won’t be able to run
> karaf. It’s basically, what pax exam is doing.
My thoughts, exactly! :-)
> It would be even simpler with Karaf5 as we have the Karaf main:
> KarafConfig config = KarafConfig.builder()
> .homeDirectory("karaf")
> .dataDirectory("karaf/data")
> .cacheDirectory("karaf/data/cache")
> .build();
> karaf = Karaf.build(config);
> karaf.init();
>
> karaf.addExtension("mvn:org.apache.karaf.extensions/log/5.0.0-SNAPSHOT");
> karaf.addModule("file:my-app.jar");
Neat API!
> So, we can do that in "code" and let heroku build it and run it.
Is it doable in karaf 4.x?
Or would one be better off waiting for karaf 5?
> We already have a full story with Kubenetes (I blogged about that, and
> I’m preparing a blog about Karaf5).
Thanks! I will read them.
> I think we can prepare a heroku use case if it’s useful.
I have currently been playing around with making my weekly allowance
app[1] run on docker.
The docker image runs fine in a local docker instance running on my
amd64 desktop machine.
But I wanted to see if the image would also run in a docker host in the
cloud.
And in that context I was looking for a free docker hosting, that didn't
require a credit card, and I ran into a way of running a docker image on
heroku[2][3].
Now, I was never able to make that work (the image loads, and I think
starts, but nothing responds on port 80).
I made one change to make the docker image respond on port 80: I made it
possible to set the port used by pax web, by setting the PORT
environment variable variable[4] (this is how heroku communicates the
port the application should run on [5]).
So my next thought was to see if heroku had karaf as an app type?
However, karaf didn't appear on on the list of languages and frameworks
supported
by heroku[6].
So I dug deeper into the Java language support and thought "Hm... that
looked promising"... and that's how this thread started...:-)
References:
[1] <https://twitter.com/steinarba/status/1337139795320053766?s=20>
[2]
<https://medium.com/@justkrup/deploy-a-docker-container-free-on-heroku-5c803d2fdeb1>
[3] <https://devcenter.heroku.com/articles/container-registry-and-runtime>
[4]
<https://github.com/steinarb/ukelonn/blob/master/docker/ukelonn/docker/org.ops4j.pax.web.cfg#L2>
[5]
<https://devcenter.heroku.com/articles/container-registry-and-runtime#dockerfile-commands-and-runtime>
[6] <https://devcenter.heroku.com/categories/language-support>