Beanstalkd in docker

I am creating 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 was 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 an Exit status of 0. I assume this means that the instance is not running. When I try to run it or attach to it, nothing happens. So the question is, why does the container not work?

Thanks Michal

+4
source share
1 answer

With service beanstalkd startyou start the server, and then exit. Do you want to run the program directly -ENTRYPOINT /usr/local/bin/beanstalkd -l 0.0.0.0 -p 11300 -b .... (etc)

+3
source

Source: https://habr.com/ru/post/1531172/


All Articles