Docker MongoDB Dockerfile Ubuntu

Source: Internet
Author: User
Tags mongodb

1. Directory structure, put the configuration files here, and so on to copy into the image to 2.mongod.conf
net:port:27017 bindip:0.0.0.0security:authorization:enabledsystemlog:destination:file Path: "/data/log/mongod. Log "LogAppend:truestorage:dbPath:"/data/db "#processManagement: # Fork:true
3. Dockerfile
#FROM  debian:wheezyfrom ubuntu# add our user and group first to  make sure their ids get assigned consistently, regardless of  whatever dependencies get addedRUN groupadd -r mongodb &&  useradd -r -g mongodb mongodbrun apt-get update run apt-key  adv --keyserver hkp://keyserver.ubuntu.com:80 --recv  0c49f3730359a14518585931bc711f9ba15703c6run echo  "Deb [ arch=amd64,arm64 ] http ://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse " | tee /etc/apt/ sources.list.d/mongodb-org-3.4.listrun apt-get updaterun apt-get install -y  mongodb-orgrun mkdir -p /data/db /data/log /data/configdb      && chown -r mongodb:mongodb /data/db /data/log /data/configdbvolume /data/db /data/log /data/configdbcopy ./ mongod.conf /data/configdb#copy docker-entrypoint.sh /entrypoint.sh#entrypoint ["/ Entrypoint.sh "]expose 27017cmd [" Mongod "]

http://www.waitingfy.com/archives/3376

Docker executes commands at a time


Docker MongoDB Dockerfile Ubuntu

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.