if i’m running docker-compose up -d in the folder with my docker-compose.yml, my container is not throwing any error but the state is Exited (0) a minute ago. If I start the Container bydocker run -dit <container-name> command every thing works just great.
What am I doing wrong?
My dockerfile
FROM ubuntu:16.04
ENV HAPROXY_VERSION=1.8
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y software-properties-common
RUN add-apt-repository -y ppa:vbernat/haproxy-$HAPROXY_VERSION && add-apt-repository -y ppa:certbot/certbot && apt-get update
RUN apt-get install -y haproxy=$HAPROXY_VERSION.\* certbot nano
RUN service haproxy stop
COPY haproxy.cfg /etc/haproxy/haproxy.cfg
ENTRYPOINT ["/bin/bash"]
CMD ["service", "haproxy", "start"]
EXPOSE 80 443
if I do this, the Container is in “Exited” state again.
CONTAINER ID 3fb042f45ac9
IMAGE haproxy_haproxy
COMMAND "haproxy -f /etc/hap…"
CREATED 34 seconds ago
STATUS Exited (0) 33 seconds ago
PORTS
NAMES haproxy_haproxy_1
Do i have to start the service in an entrypoint.sh script?