Tuesday 15 June 2010

riak - Run a service automatically in a docker container -


I am installing a simple image: the one that holds the REIK (a node SQL database). Image Reiki service starts with Riak start as a CMD now, if I call it a form of daemon with the Docker Run-de Quintanc / Reekk-Dev I run it in, then it starts the rayak process (I can see in log). However, it automatically closes after a few seconds. If I have run it using the Docker Run-i -T Quintink / RIiIK-DII / BIN / BSS / / code>, then the REC process has not started (UPDATE: see the answer to an explanation for this). In fact, no services are running at all. I can start it manually using the terminal, but I would like to start Reeck automatically. I think this behavior will be for other services also, RI is just one example.

In this way, running / restarting the container should start automatically. What is the correct way to set it up?


For reference, there is a dockerfile with which the image can be created (updated: changed using the chosen answer):

  Ubuntu From: Update the 12.04 RUn-App-Update, Install RTN APT-Go- and OpenSearch-Server at http://apt.basho.com/gpg/basho.apt.key | APT-Key Aid - RUn Bash-C "Echo Debit http://apt.basho.com Exact Chief> /etc/apt/sources.list.d/basho.list" RUn-App-Update Update RNN Epte- Y install riak RUN perl -p -i -e '/ (? & Lt; = \ {http, \ s \ [\ s \ {"} 127 \ .0 \ .0 \ .1 / 0.0.0.0 / gm' /etc/riak/app.config EXPOSE 8098 CMD / bin / RIBB start and amp; tail-f /var/log/riak/erlang.log.1   

edit: -f According to his commentary has been changed to CMD


My own answer

After working with Docker for some time I was supervisory If you want an example code for that, see I am using my supervisor image as the basis for all my other images. I blog on using the supervisor.

To run docking containers, you need to have a process in the foreground to be active.

So you may possibly cmd / bin / Araiai console

or even

  cmd / bin / Riak start and amp; Amp; Tail-F /var/log/riak/erlang.log.1   

Note that you do not have more than one line of CMD statement, only gets run for the last time .

No comments:

Post a Comment