istepanov / docker-mongodump

Docker image with mongodump, cron task and upload to AWS S3
https://hub.docker.com/repository/docker/istepanov/mongodump
MIT License
100 stars 78 forks source link

env vars are not available in cron jobs #1

Closed jonotron closed 9 years ago

jonotron commented 9 years ago

When I run this container, the backup.sh script does not get the environment variables set for it and thus fails to work properly.

This PR changes the start script to write the current environment variables for the docker container to /tmp/mongodump_env, then when the backup script runs in the cron context it can source the variables to work correctly.