>>>>> Jean-Baptiste Onofré <[email protected]>:

> Both cases work with Docker, maybe case 1 is "more" interesting (but
> it depends of your provisioning scenario).

@Andrei, as JB hints at there are many ways to dockerize karaf
applications.

My applications are provisioned by creating karaf features and deploy
OSGi bundles and karaf features to a maven repository, and then load the
features in karaf.

So for docker, what I've done is to start with the standard karaf docker
image deployed to dockerhub, and then override the file
etc/org.apache.karaf.features.cfg in the karaf installation in the
docker image, with a file that loads the LATEST version my feature(s).

I also deploy versions of the JDBC Config files of my application, that
can have the URL and USERNAME/PASSWORD values set from environment
variables, making them easy to set in the deploy.

That means that when I deploy my image it can provision from the newest
deploy to maven, without me having to build a new docker image.

Here's an example of a maven module that builds a docker image on top of
the standard karaf docker image:
 https://github.com/steinarb/sonar-collector/tree/master/docker

Caveat emptor! I haven't run this for a while so it may not be working
right now (I probably have to update the docker image version to a newer
karaf version).

FWIW My deployment model is to have a single karaf instance in my VPS,
deploying all of my applications as OSGi bundles.

Works like a charm for me!

Reply via email to