mirror of
https://github.com/bitnami/containers.git
synced 2026-04-05 00:37:57 +08:00
Added `MONGODB_USER`, `MONGODB_PASSWORD` and `MONGODB_DATABASE` parameters to create user and database at first run. The `MONGODB_USER` (default: `root`) and `MONGODB_PASSWORD` parameters indicate if authentication `--auth` is enabled on the server, else the server allows unauthenticated access. The user is created only if `MONGODB_PASSWORD` is also specified. The default `root` user is assigned `userAdminAnyDatabase` role on the `admin` database giving the `root` user complete administrative access to the mongo server.
23 lines
696 B
Docker
23 lines
696 B
Docker
FROM bitnami/base-ubuntu:14.04-onbuild
|
|
MAINTAINER Bitnami <containers@bitnami.com>
|
|
|
|
ENV BITNAMI_APP_NAME=mongodb \
|
|
BITNAMI_APP_USER=mongodb \
|
|
BITNAMI_APP_VERSION=3.0.5-0
|
|
|
|
ENV BITNAMI_APP_DIR=$BITNAMI_PREFIX/$BITNAMI_APP_NAME \
|
|
BITNAMI_APP_VOL_PREFIX=/bitnami/$BITNAMI_APP_NAME
|
|
|
|
ENV PATH=$BITNAMI_APP_DIR/bin:$BITNAMI_PREFIX/common/bin:$PATH
|
|
|
|
|
|
RUN sh $BITNAMI_PREFIX/install.sh --mongodb_password bitnami --disable-components common
|
|
|
|
COPY bitnami-utils-custom.sh /bitnami-utils-custom.sh
|
|
COPY entrypoint.sh /entrypoint.sh
|
|
|
|
EXPOSE 27017
|
|
VOLUME ["$BITNAMI_APP_VOL_PREFIX/data", "$BITNAMI_APP_VOL_PREFIX/conf", "$BITNAMI_APP_VOL_PREFIX/logs"]
|
|
ENTRYPOINT ["/entrypoint.sh"]
|
|
CMD ["mongod"]
|