I created an image from a Dockerfile:
FROM debian:latest
RUN apt-get update && apt-get install -y \
mosquitto \
&& rm -rf /var/lib/apt/lists/*
# mosquitto setup
EXPOSE 1883
COPY config/broker/conf.d/ /etc/mosquitto/conf.d/
CMD mosquitto
This works, but I'd like to start mosquitto as a service (is it recommended at all?). But when I replace the last line with
CMD service mosquitto start
the service doesn't start & I the container isn't running (but I don't get an error message during image creation)