0

I'm fairly new to boot2docker and have some problem installing a process manager in it.

The setup I'm going for is to use vagrant to create my local boot2docker development machine and configure the containers inside that VM. The Vagrant box I'm using is this one: yungsang/boot2docker.

I have setup the boot2docker VM to create one container with this:

config.vm.provision :docker do |d|
     d.pull_images "wkruse/eventstore"
     d.run "eventstore",
         image: "wkruse/eventstore",
         args: "-p 1113:1113 -p 2113:2113 -v /data:/data",
         cmd: "--ext-ip=0.0.0.0 --http-prefixes=\"http://*:2113/\" --run-projections=all"
end

This works just fine except that the container is not started on boot. Is there a way to configure docker so it starts all the container on start, or is there a simple way to install a process manager like systemd in boot2docker that handles the start of the containers?

UPDATE

I've changed approach and use a simple script instead, but it won't work:

docker run -d -p 2113:2113 -p 1113:1113 -v /data/eventstore:/data --restart=always --name eventstore wkruse/eventstore --ext-ip=0.0.0.0 --http-prefixes="http://*:2113/" --run-projections=all

I have another container where I basically do exactly the same thing, and it works like a charm. I've also tried --restart=on-failures:10 but that doesn't work either.

UPDATE 2

If I remove -v /data/eventstore:/data it all works as I expect. Somewhat weird I think.

Tomas Jansson
  • 22,767
  • 13
  • 83
  • 137

1 Answers1

1

Add --restart always to your args: line.

Peter Lyons
  • 142,938
  • 30
  • 279
  • 274
  • Is that supposed to work if I reboot the boot2docker instance? For me it didn't when I tried. Maybe I should try even harder :) – Tomas Jansson Feb 16 '15 at 11:55
  • You're right, this should work but for some reason I have one container this doesn't work for. I've tried `--restart=always` but on reboot it just says `exited`. I can restart the container manually through `docker start containerName`, but restart still fails. Weird. – Tomas Jansson Mar 01 '15 at 12:59
  • I updated the question with some observations I made. – Tomas Jansson Mar 01 '15 at 13:08