Code Monkey home page Code Monkey logo

mongo-alpine's Introduction

docker-mongo-alpine

?

也不知道为什么mongo官方不出alpine版本的docker

其他的都太大了 我们公司项目打包好要2个多G
网上找到的都不能直接设置用户名密码,也不能执行初始化脚本 就很麻烦啊
自己就弄了个这 放上来让大家省点事

Pull

docker pull ztyhehe/mongo-alpine

Build

docker build -t mongo-alpine .

PS:
3.10移除了Mongodb 在仓库中
https://alpinelinux.org/posts/Alpine-3.10.0-released.html

运行

docker run -p 27017:27017 -v ~/db:/data/db mongo-alpine
PS: mongo运行是使用mongodb用户运行的 不要修改映射目录权限不然会起不来 提示目录只读

数据库初始化脚本

/docker-entrypoint-initdb.d文件夹里面的.sh, .js文件会被执行

用户名、密码

可以通过环境变量MONGO_INITDB_ROOT_USERNAMEMONGO_INITDB_ROOT_PASSWORD设置
也可以通过/docker-entrypoint-initdb.d文件夹里的脚本设置

通过环境变量设置账号密码
用户验证库是admin rootAuthDatabase='admin'
用户权限是root

mongo-alpine's People

Contributors

ztyhehe avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.