ot4i / iib-docker

Eclipse Public License 1.0
63 stars 115 forks source link

Can the db2 client and iib be installed in the container together? #30

Closed vtanner11 closed 6 years ago

s-rogers commented 7 years ago

Yes - this is absolutely possible - you would need to add in the right commands in the Dockerfile to add and setup the client, which would then be available as normal inside the container.

vtanner11 commented 7 years ago

Is there a sample Dockerfile or install.sh file available?

s-rogers commented 7 years ago

https://www.ibm.com/support/knowledgecenter/en/SSEPGG_10.5.0/com.ibm.swg.im.dbclient.install.doc/doc/t0007317.html

dennisseidel commented 7 years ago

I would suggest you install the db-client in a different layer. You can have a look how I do it with the mqclient (https://github.com/dennisseidel/ibm-integration-bus-docker-bestpractice/tree/master/iib-mqclient). This allows you to rebuild only the relevant parts of your image and you are not forced to rebuild for example the complete IIB image but only the db2 client part when you update the client.

vtanner11 commented 7 years ago

So the iib image would be build from two images - mq and db2? I will need all three - mq, iib and db2.

dennisseidel commented 7 years ago

Well first the question is do you need an mq or a mq client in the iib container. But in your example you might think about writing 3 Dockerfiles:

  1. For example just reuse this one or one of the dockerfiles I created.
  2. In the next one you would then define FROM: iib:base ... and install mq -> this would create the iib:mq image
  3. The 3rd file would den have a FROM: iib:mq ... and you install the db2 client

You should not let these dependency chains to far, so it might make some sense to put iib and mq into one image and add db2 in to a dependent image.
But the decision how to design your images is really based on your ecosystem, and how you want to use the image. You can use them as empty containers, that are filled manually at runtime (that is perfectly fine) -> then you would build the image itself more like this image. Or you actually want the container when it starts/restarts to deploy you application (bar file) automatically configure and connect to a database. Then you can have a look at a sample (which is far from perfect!) in my repo.

So to actually answer your first question: yes you can perfectly do it, how you do it really depends on your use cases and your ecosystem you need to support.

s-rogers commented 6 years ago

Great info from @denseidel - I think this one is answered.