Files for building MongoDB docker container.

run_mongodb.sh 702B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/bin/bash
  2. #
  3. # Run the docker container
  4. #
  5. # Input traffic only, via specified port.
  6. # Mount volume being synced, too: /opt/mongodb
  7. #
  8. # Can bind the interface to an IP at the docker layer:
  9. #
  10. # -p <bind-ip>:27017:27017
  11. #
  12. # http://charlesreid1.com/wiki/Docker/Basics
  13. HOSTIP="10.6.0.2"
  14. debug=false
  15. #debug=true
  16. docker ps -qa | xargs docker rm
  17. if [ "$debug" == true ]; then
  18. docker run \
  19. --name happy_mongo \
  20. -p ${HOSTIP}:27017:27017 \
  21. -v /opt/mongodb:/data \
  22. -ti jupitermongo \
  23. /bin/bash
  24. else
  25. docker run \
  26. --name happy_mongo \
  27. -p ${HOSTIP}:27017:27017 \
  28. -v /opt/mongodb:/data \
  29. -d \
  30. -ti jupitermongo
  31. fi