I am trying to reuse existing cookbooks within docker containers, but most recipes will start the service during the chef client run (e.g. tomcat, apache2). As chef-solo runs during image creation the chef run will simply fail.
How can I prevent a cookbook from starting a service?
I am using the following Dockerfile
FROM jr42/chef-solo-centos
ADD chef /chef
RUN cd /chef && /opt/chef/embedded/bin/berks vendor /chef/cookbooks
RUN chef-solo -N mynode -c /chef/solo.rb -j /chef/solo.json
tomcat in my runbook (solo.json):
{
"tomcat": {
"base_version": ""
},
"run_list": [ "recipe[tomcat]" ]
}
and Berksfile:
source "https://supermarket.getchef.com"
metadata
cookbook 'tomcat'