Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Beanstalkd in docker

I'm building a Docker image with this Dockerfile

FROM ubuntu:12.04
ENV DEBIAN_FRONTEND noninteractive
ENV PATH /usr/local/rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

# update apt
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update
RUN apt-get -y dist-upgrade
RUN apt-get install -y beanstalkd

RUN sed -i 's/\#START=yes/START=yes/g' /etc/default/beanstalkd

EXPOSE 11300
ENTRYPOINT service beanstalkd start

The image is successfully built and then I want to create an instance:

docker run -i -d -p 11300:11300 beanstalk /bin/bash

However, when I do docker ps -a, the instance has status Exit 0. I'm assuming that this means that the instance is not running. When I try to start it or attach to it, nothing seems to be happening. So the question is why is the container not running?

Thanks, Michal

like image 675
Michal Holub Avatar asked Mar 11 '14 14:03

Michal Holub


1 Answers

With service beanstalkd start you are starting the server, and then exiting. You will want to run the program directly - ENTRYPOINT /usr/local/bin/beanstalkd -l 0.0.0.0 -p 11300 -b .... (etc)

like image 198
Alister Bulman Avatar answered Sep 20 '22 21:09

Alister Bulman