Browse Source

fix run mongo script, include a debug switch

master
Charles Reid 1 year ago
parent
commit
c2a425f7f5
1 changed files with 31 additions and 14 deletions
  1. +31
    -14
      run_mongodb.sh

+ 31
- 14
run_mongodb.sh View File

@@ -8,24 +8,41 @@
# http://charlesreid1.com/wiki/Docker/Basics

function usage {
echo ""
echo "run_mongodb.sh script:"
echo "run the mongodb docker container."
echo ""
echo " ./run_mongodb.sh"
echo ""
echo ""
echo "run_mongodb.sh script:"
echo "run the mongodb docker container."
echo ""
echo " ./run_mongodb.sh"
echo ""
}

#debug=false
debug=true

docker run \
--name happy_mongo \
-p 192.168.125.28:27017:27017 \
-p 10.6.0.1:27017:27017 \
-v /opt/mongodb:/data/db \
-d \
-ti jupitermongo
if [ "$debug" == true ]; then

# --network=host \
docker run \
--name happy_mongo \
-p 27017:27017 \
-v /opt/mongodb:/data \
-ti jupitermongo \
/bin/bash

else:

docker run \
--name happy_mongo \
-p 27017:27017 \
-v /opt/mongodb:/data \
-d \
-ti jupitermongo

fi

# -d \
# --network=host \
# -p 10.6.0.1:27017:27017 \
# -p 127.0.0.1:27017:27017 \

# Add this to expose the web interface for MongoDB
# (also update the Dockerfile):

Loading…
Cancel
Save