10

I have been trying to install Chef-Server in a Docker container and I am having some trouble. I am running a VM with an up to date version of Ubuntu 12.04 and latest install of Docker. I run a base Docker Ubuntu 12.04 container and install chef-server, version 11.0.12 and that goes well. The problem is running the required 'sudo chef-server-ctl reconfigure' step after install. The setup freezes at

  * link[/opt/chef-server/init/rabbitmq] action create (up to date)
  * link[/opt/chef-server/service/rabbitmq] action create (up to date)
  * **ruby_block[supervise_rabbitmq_sleep] action run**

and I get a stacktrace.out of

**SystemExit: ruby_block[supervise_rabbitmq_sleep] (chef-server::rabbitmq line 161) had an error: SystemExit: exit**
/opt/chef-server/embedded/cookbooks/runit/definitions/runit_service.rb:165:in `sleep'
/opt/chef-server/embedded/cookbooks/runit/definitions/runit_service.rb:165:in `block (3 levels) in from_file'

If anyone has experienced this and/or has any ideas I would appreciate it.

Thanks!

Laurent Bristiel
  • 6,819
  • 34
  • 52
Greg
  • 382
  • 1
  • 5
  • 14

2 Answers2

9

There is an image available in the docker registry.

docker pull  base/chef-server
docker run -d -p 443:443 base/chef-server

The Dockerfile is available here:

Mark O'Connor
  • 76,015
  • 10
  • 139
  • 185
2

I had this problem. Increasing shared memory made it disappear. Run a container with option: --privileged and before starting chef server, run: sysctl -w kernel.shmmax=1288490189 (for me 1288490189 bytes which is 1.2GB was enough).

The docker image suggested in Mark O'Connor answer did not work for me (Unable to start database connection), I tried also cbuisson/chef-server (was reconfiguring endlessly) and finally I came up with my own: xmik/chef-server-docker (used Ubuntu 14.04).

Ewa
  • 553
  • 7
  • 13
  • how do I test once the container is up & running? – sudhishkr Jan 17 '16 at 02:03
  • As far as I know, in Chef Server 11, you had to configure the first user through its website, which made it hard for testing. In Chef Server 12 you can use `chef-server-ctl user-create`. I now use Chef Server 12 together with berkshelf-api and perhaps you find this manual test helpful: [berkshelf-api-docker/test/run.sh](https://github.com/xmik/berkshelf-api-docker/blob/master/test/run.sh) (it uses different docker image with chef server). – Ewa Jan 18 '16 at 10:26