Domanda

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

È stato utile?

Soluzione

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)

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top