Thursday, June 11, 2020

Quick Hack to debug your docker image in cloudfoundry

I am trying to make a docker image bind with the kafka service on SAP's Cloudfoundry Platform. The kafka on SCP works on SASL authentication, and needs some configuration. 
Now the docker image has a start command which directly launches my process which binds to the Kafka Service, tries to connect to Kafka Cluster and fails because of some misconfiguration. 
It's almost impossible to try the configuration, unless I change the environment and then push the image to my repository, and then push the image from repository to cloudfoundry. 
Too Painful. 
So a quick hack to solve the problem is to change the startup command of my docker image to 

CMD tail -f /dev/null

And change the health check type in manifest to none. 

Push the image back in CF and ssh into it, to fiddle with the environment as many times as you like :). 

Happy Coding!!

Abhishek

No comments: