mongodb.dockerfile 538 B

123456789101112131415
  1. FROM ubuntu:16.04
  2. COPY ./ ./
  3. RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
  4. RUN echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-3.6.list
  5. RUN apt-get -y update
  6. RUN apt-get -y install mongodb-org
  7. RUN mkdir -p /data/db
  8. RUN chmod 777 /data/db
  9. RUN mongod --fork --logpath /var/log/mongodb.log --bind_ip_all && sleep 10 && mongo < create.js && sleep 10
  10. CMD ["mongod", "--bind_ip_all"]