├── .gitignore ├── mongodb.repo ├── README.md ├── Dockerfile ├── run.sh └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mongodb.repo: -------------------------------------------------------------------------------- 1 | [mongodb] 2 | name=MongoDB Repository 3 | baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/ 4 | gpgcheck=0 5 | enabled=1 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Dockerfile for MongoDB MMS agents 2 | 3 | Built images are hosted at https://registry.hub.docker.com/u/state/mongodb-mms 4 | 5 | # Configuration 6 | 7 | Via environment variables: 8 | 9 | - `MMS_AGENT_API_KEY` 10 | - `MMS_AGENT` - either `monitoring` or `backup`. Default is `monitoring`. 11 | 12 | # License 13 | 14 | See LICENSE 15 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM fedora:21 2 | 3 | RUN yum update -y -q; yum clean all 4 | RUN yum install -y -q \ 5 | hostname \ 6 | https://mms.mongodb.com/download/agent/monitoring/mongodb-mms-monitoring-agent-2.9.0.164-1.x86_64.rhel7.rpm \ 7 | https://mms.mongodb.com/download/agent/backup/mongodb-mms-backup-agent-3.0.0.246-1.x86_64.rhel7.rpm 8 | 9 | ADD run.sh /run.sh 10 | 11 | CMD /run.sh 12 | -------------------------------------------------------------------------------- /run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | : ${MMS_AGENT:=monitoring} 4 | 5 | if [[ -n ${MMS_AGENT_API_KEY} ]]; then 6 | sed -e "s/mmsApiKey=/mmsApiKey=${MMS_AGENT_API_KEY}/" \ 7 | -i /etc/mongodb-mms/backup-agent.config \ 8 | -i /etc/mongodb-mms/monitoring-agent.config 9 | else 10 | echo 'MMS_AGENT_API_KEY must be set. Exiting..' 11 | exit 1 12 | fi 13 | 14 | # Where is consistency!? 15 | if [[ ${MMS_AGENT} == 'monitoring' ]]; then 16 | conf_flag='-conf' 17 | else 18 | conf_flag='-c' 19 | fi 20 | 21 | 22 | if [[ $# -lt 1 ]] || [[ "$1" == "--"* ]]; then 23 | exec /usr/bin/mongodb-mms-${MMS_AGENT}-agent ${conf_flag} /etc/mongodb-mms/${MMS_AGENT}-agent.config "$@" 24 | fi 25 | 26 | exec "$@" 27 | 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Equal Media Limited 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | --------------------------------------------------------------------------------