That's pretty much it except it doesn't use the Kar file.  It pulls a 
distribution of Karaf that has been slimmed down, installs all the bundles, 
configuration files, and then zips up the entire Karaf instance with all its 
dependencies.  Unzip it, go to the bin directory, and run the Karaf container.  
So it may be easy to put that in a Docker container as it is generic from the 
perspective of Docker and doesn't have any specific requirements - just general 
ones like a JVM, a mechanism to unzip the Karaf container with dependencies, 
and a way to run it automatically.

All the required dependencies to run your application are in the Karaf/system 
folder.  Because the dynamic install mechanisms have been removed the container 
is quite small.

-----Original Message-----
From: CodeCola [mailto:[email protected]] 
Sent: Thursday, January 12, 2017 11:01 AM
To: [email protected]
Subject: Re: Levels of Containerization - focus on Docker and Karaf

Thanks for a great discussion especially the insights from real world 
deployments. This is what I understand:

*"Static" Karaf Profiles*

Docker images should be based on a "static distribution" of Karaf generated 
from Profiles. Starting from Profiles, one can generate a docker image and push 
it to a registry.  The image would contain all the needed bundles and would not 
have to be further "provisioned".  This resembles the "static container" idea 
which is the basis for Docker application packaging.

In principle, you want to have the following steps:
•       Create a Karaf feature from your application 
•       Assemble it to a kar file (a custom Karaf distribution)
•       Deploy the new Karaf package to Docker

fabric8 has a maven-plugin for doing this which is well documented.
https://maven.fabric8.io/

Or

Can be done by using the karaf maven plugin and configuring startupFeatures and 
referencing the static kar, as shown in:
  https://github.com/apache/karaf/blob/master/demos/profiles/static/pom.xml


Karaf section about custom assembly builds 
https://karaf.apache.org/manual/latest/#_custom_distributions


*Naming and Packaging*
Docker will likely influence how you package and provision your Karaf 
distributions. For instance, you will eventually have to provide a Docker image 
with a pre-configured Karaf, KAR files in deployment folder, etc. so that your 
Kubernetes container may bootstrap everything on boot.
Cellar Kubernetes discovery service is a great complement to the Karaf 
docker.io feature (allowing you to easily create and manage docker.io images in 
and for Karaf). To install the Kubernetes discovery service, simply install 
cellar-kubernetes feature.
        karaf@root()> feature:install cellar-kubernetes


Question -* What is Karaf Boot?*
Could only find: https://github.com/jbonofre/karaf-boot

There isn't enough documentation!



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Levels-of-Containerization-focus-on-Docker-and-Karaf-tp4049162p4049188.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Reply via email to