I am trying to install mongodb on ubuntu 14.04 in a docker container, using the following steps from the official mongodb guides in my Dockerfile:
RUN sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
RUN echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
RUN apt-get update && apt-get -q -y install \
nodejs\
npm \
git \
mongodb-org
These commands install mongodb properly on my host ubuntu system, but not in docker. In my docker image, /etc/init.d/mongod is not there. The following error is printed while running "docker build":
invoke-rc.d: unknown initscript, /etc/init.d/mongod not found.
invoke-rc.d: policy-rc.d denied execution of start.