Public Repository

Last pushed: a year ago
Short Description
Designed for raspberry pi. Runs mongodb on the /data volume.
Full Description

Dockerfile:

FROM armv7/armhf-ubuntu_core:16.10

VOLUME /data

RUN apt-get update -y && apt-get upgrade -y && apt-get install -y \
mongodb-server

COPY mongod.sh /srv/mongod.sh
RUN chmod +x /srv/mongod.sh

ENTRYPOINT ["/srv/mongod.sh"]

EXPOSE 27017

mongod.sh:

#!/bin/bash

function quit {
echo "quitting mongod"
mongod --shutdown --dbpath /data
exit 0
}

trap 'quit' 2
trap 'quit' SIGTERM

function start_mongod {
echo "mongod --dbpath /data --fork --logpath /var/log/mongodb.log"
mongod --dbpath /data --fork --logpath /var/log/mongodb.log
}

function repair_mongod {
echo "mongod --repair --dbpath /data"
mongod --repair --dbpath /data
start_mongod
}

start_mongod || repair_mongod

echo "Waiting"
while true
do
:
done

Docker Pull Command
Owner
simonlammer

Comments (0)