Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions 3.6/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,9 @@ _js_escape() {
jq --null-input --arg 'str' "$1" '$str'
}

jsonConfigFile="${TMPDIR:-/tmp}/docker-entrypoint-config.json"
tempConfigFile="${TMPDIR:-/tmp}/docker-entrypoint-temp-config.json"
: "${TMPDIR:=/tmp}"
jsonConfigFile="$TMPDIR/docker-entrypoint-config.json"
tempConfigFile="$TMPDIR/docker-entrypoint-temp-config.json"
_parse_config() {
if [ -s "$tempConfigFile" ]; then
return 0
Expand Down Expand Up @@ -242,9 +243,11 @@ if [ "$originalArgOne" = 'mongod' ]; then
if _parse_config "$@"; then
_mongod_hack_ensure_arg_val --config "$tempConfigFile" "${mongodHackedArgs[@]}"
fi
_mongod_hack_ensure_arg_val --bind_ip 127.0.0.1 "${mongodHackedArgs[@]}"
_mongod_hack_ensure_arg_val --bind_ip '' "${mongodHackedArgs[@]}"
_mongod_hack_ensure_arg_val --port 27017 "${mongodHackedArgs[@]}"
_mongod_hack_ensure_arg_val --unixSocketPrefix "$TMPDIR" "${mongodHackedArgs[@]}"
_mongod_hack_ensure_no_arg --bind_ip_all "${mongodHackedArgs[@]}"
_mongod_hack_ensure_no_arg --nounixsocket "${mongodHackedArgs[@]}"

# remove "--auth" and "--replSet" for our initial startup (see https://docs.mongodb.com/manual/tutorial/enable-authentication/#start-mongodb-without-access-control)
# https://github.com/docker-library/mongo/issues/211
Expand Down Expand Up @@ -278,13 +281,13 @@ if [ "$originalArgOne" = 'mongod' ]; then
fi
_mongod_hack_ensure_arg --logappend "${mongodHackedArgs[@]}"

pidfile="${TMPDIR:-/tmp}/docker-entrypoint-temp-mongod.pid"
pidfile="$TMPDIR/docker-entrypoint-temp-mongod.pid"
rm -f "$pidfile"
_mongod_hack_ensure_arg_val --pidfilepath "$pidfile" "${mongodHackedArgs[@]}"

"${mongodHackedArgs[@]}" --fork

mongo=( mongo --host 127.0.0.1 --port 27017 --quiet )
mongo=( mongo --host "$TMPDIR/mongodb-27017.sock" --quiet )

# check to see that our "mongod" actually did start up (catches "--help", "--version", MongoDB 3.2 being silly, slow prealloc, etc)
# https://jira.mongodb.org/browse/SERVER-16292
Expand Down
13 changes: 8 additions & 5 deletions 4.0/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,9 @@ _js_escape() {
jq --null-input --arg 'str' "$1" '$str'
}

jsonConfigFile="${TMPDIR:-/tmp}/docker-entrypoint-config.json"
tempConfigFile="${TMPDIR:-/tmp}/docker-entrypoint-temp-config.json"
: "${TMPDIR:=/tmp}"
jsonConfigFile="$TMPDIR/docker-entrypoint-config.json"
tempConfigFile="$TMPDIR/docker-entrypoint-temp-config.json"
_parse_config() {
if [ -s "$tempConfigFile" ]; then
return 0
Expand Down Expand Up @@ -242,9 +243,11 @@ if [ "$originalArgOne" = 'mongod' ]; then
if _parse_config "$@"; then
_mongod_hack_ensure_arg_val --config "$tempConfigFile" "${mongodHackedArgs[@]}"
fi
_mongod_hack_ensure_arg_val --bind_ip 127.0.0.1 "${mongodHackedArgs[@]}"
_mongod_hack_ensure_arg_val --bind_ip '' "${mongodHackedArgs[@]}"
_mongod_hack_ensure_arg_val --port 27017 "${mongodHackedArgs[@]}"
_mongod_hack_ensure_arg_val --unixSocketPrefix "$TMPDIR" "${mongodHackedArgs[@]}"
_mongod_hack_ensure_no_arg --bind_ip_all "${mongodHackedArgs[@]}"
_mongod_hack_ensure_no_arg --nounixsocket "${mongodHackedArgs[@]}"

# remove "--auth" and "--replSet" for our initial startup (see https://docs.mongodb.com/manual/tutorial/enable-authentication/#start-mongodb-without-access-control)
# https://github.com/docker-library/mongo/issues/211
Expand Down Expand Up @@ -278,13 +281,13 @@ if [ "$originalArgOne" = 'mongod' ]; then
fi
_mongod_hack_ensure_arg --logappend "${mongodHackedArgs[@]}"

pidfile="${TMPDIR:-/tmp}/docker-entrypoint-temp-mongod.pid"
pidfile="$TMPDIR/docker-entrypoint-temp-mongod.pid"
rm -f "$pidfile"
_mongod_hack_ensure_arg_val --pidfilepath "$pidfile" "${mongodHackedArgs[@]}"

"${mongodHackedArgs[@]}" --fork

mongo=( mongo --host 127.0.0.1 --port 27017 --quiet )
mongo=( mongo --host "$TMPDIR/mongodb-27017.sock" --quiet )

# check to see that our "mongod" actually did start up (catches "--help", "--version", MongoDB 3.2 being silly, slow prealloc, etc)
# https://jira.mongodb.org/browse/SERVER-16292
Expand Down
13 changes: 8 additions & 5 deletions 4.2/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,9 @@ _js_escape() {
jq --null-input --arg 'str' "$1" '$str'
}

jsonConfigFile="${TMPDIR:-/tmp}/docker-entrypoint-config.json"
tempConfigFile="${TMPDIR:-/tmp}/docker-entrypoint-temp-config.json"
: "${TMPDIR:=/tmp}"
jsonConfigFile="$TMPDIR/docker-entrypoint-config.json"
tempConfigFile="$TMPDIR/docker-entrypoint-temp-config.json"
_parse_config() {
if [ -s "$tempConfigFile" ]; then
return 0
Expand Down Expand Up @@ -242,9 +243,11 @@ if [ "$originalArgOne" = 'mongod' ]; then
if _parse_config "$@"; then
_mongod_hack_ensure_arg_val --config "$tempConfigFile" "${mongodHackedArgs[@]}"
fi
_mongod_hack_ensure_arg_val --bind_ip 127.0.0.1 "${mongodHackedArgs[@]}"
_mongod_hack_ensure_arg_val --bind_ip '' "${mongodHackedArgs[@]}"
_mongod_hack_ensure_arg_val --port 27017 "${mongodHackedArgs[@]}"
_mongod_hack_ensure_arg_val --unixSocketPrefix "$TMPDIR" "${mongodHackedArgs[@]}"
_mongod_hack_ensure_no_arg --bind_ip_all "${mongodHackedArgs[@]}"
_mongod_hack_ensure_no_arg --nounixsocket "${mongodHackedArgs[@]}"

# remove "--auth" and "--replSet" for our initial startup (see https://docs.mongodb.com/manual/tutorial/enable-authentication/#start-mongodb-without-access-control)
# https://github.com/docker-library/mongo/issues/211
Expand Down Expand Up @@ -278,13 +281,13 @@ if [ "$originalArgOne" = 'mongod' ]; then
fi
_mongod_hack_ensure_arg --logappend "${mongodHackedArgs[@]}"

pidfile="${TMPDIR:-/tmp}/docker-entrypoint-temp-mongod.pid"
pidfile="$TMPDIR/docker-entrypoint-temp-mongod.pid"
rm -f "$pidfile"
_mongod_hack_ensure_arg_val --pidfilepath "$pidfile" "${mongodHackedArgs[@]}"

"${mongodHackedArgs[@]}" --fork

mongo=( mongo --host 127.0.0.1 --port 27017 --quiet )
mongo=( mongo --host "$TMPDIR/mongodb-27017.sock" --quiet )

# check to see that our "mongod" actually did start up (catches "--help", "--version", MongoDB 3.2 being silly, slow prealloc, etc)
# https://jira.mongodb.org/browse/SERVER-16292
Expand Down
13 changes: 8 additions & 5 deletions 4.4/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,9 @@ _js_escape() {
jq --null-input --arg 'str' "$1" '$str'
}

jsonConfigFile="${TMPDIR:-/tmp}/docker-entrypoint-config.json"
tempConfigFile="${TMPDIR:-/tmp}/docker-entrypoint-temp-config.json"
: "${TMPDIR:=/tmp}"
jsonConfigFile="$TMPDIR/docker-entrypoint-config.json"
tempConfigFile="$TMPDIR/docker-entrypoint-temp-config.json"
_parse_config() {
if [ -s "$tempConfigFile" ]; then
return 0
Expand Down Expand Up @@ -242,9 +243,11 @@ if [ "$originalArgOne" = 'mongod' ]; then
if _parse_config "$@"; then
_mongod_hack_ensure_arg_val --config "$tempConfigFile" "${mongodHackedArgs[@]}"
fi
_mongod_hack_ensure_arg_val --bind_ip 127.0.0.1 "${mongodHackedArgs[@]}"
_mongod_hack_ensure_arg_val --bind_ip '' "${mongodHackedArgs[@]}"
_mongod_hack_ensure_arg_val --port 27017 "${mongodHackedArgs[@]}"
_mongod_hack_ensure_arg_val --unixSocketPrefix "$TMPDIR" "${mongodHackedArgs[@]}"
_mongod_hack_ensure_no_arg --bind_ip_all "${mongodHackedArgs[@]}"
_mongod_hack_ensure_no_arg --nounixsocket "${mongodHackedArgs[@]}"

# remove "--auth" and "--replSet" for our initial startup (see https://docs.mongodb.com/manual/tutorial/enable-authentication/#start-mongodb-without-access-control)
# https://github.com/docker-library/mongo/issues/211
Expand Down Expand Up @@ -278,13 +281,13 @@ if [ "$originalArgOne" = 'mongod' ]; then
fi
_mongod_hack_ensure_arg --logappend "${mongodHackedArgs[@]}"

pidfile="${TMPDIR:-/tmp}/docker-entrypoint-temp-mongod.pid"
pidfile="$TMPDIR/docker-entrypoint-temp-mongod.pid"
rm -f "$pidfile"
_mongod_hack_ensure_arg_val --pidfilepath "$pidfile" "${mongodHackedArgs[@]}"

"${mongodHackedArgs[@]}" --fork

mongo=( mongo --host 127.0.0.1 --port 27017 --quiet )
mongo=( mongo --host "$TMPDIR/mongodb-27017.sock" --quiet )

# check to see that our "mongod" actually did start up (catches "--help", "--version", MongoDB 3.2 being silly, slow prealloc, etc)
# https://jira.mongodb.org/browse/SERVER-16292
Expand Down
13 changes: 8 additions & 5 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,9 @@ _js_escape() {
jq --null-input --arg 'str' "$1" '$str'
}

jsonConfigFile="${TMPDIR:-/tmp}/docker-entrypoint-config.json"
tempConfigFile="${TMPDIR:-/tmp}/docker-entrypoint-temp-config.json"
: "${TMPDIR:=/tmp}"
jsonConfigFile="$TMPDIR/docker-entrypoint-config.json"
tempConfigFile="$TMPDIR/docker-entrypoint-temp-config.json"
_parse_config() {
if [ -s "$tempConfigFile" ]; then
return 0
Expand Down Expand Up @@ -242,9 +243,11 @@ if [ "$originalArgOne" = 'mongod' ]; then
if _parse_config "$@"; then
_mongod_hack_ensure_arg_val --config "$tempConfigFile" "${mongodHackedArgs[@]}"
fi
_mongod_hack_ensure_arg_val --bind_ip 127.0.0.1 "${mongodHackedArgs[@]}"
_mongod_hack_ensure_arg_val --bind_ip '' "${mongodHackedArgs[@]}"
_mongod_hack_ensure_arg_val --port 27017 "${mongodHackedArgs[@]}"
_mongod_hack_ensure_arg_val --unixSocketPrefix "$TMPDIR" "${mongodHackedArgs[@]}"
_mongod_hack_ensure_no_arg --bind_ip_all "${mongodHackedArgs[@]}"
_mongod_hack_ensure_no_arg --nounixsocket "${mongodHackedArgs[@]}"

# remove "--auth" and "--replSet" for our initial startup (see https://docs.mongodb.com/manual/tutorial/enable-authentication/#start-mongodb-without-access-control)
# https://github.com/docker-library/mongo/issues/211
Expand Down Expand Up @@ -278,13 +281,13 @@ if [ "$originalArgOne" = 'mongod' ]; then
fi
_mongod_hack_ensure_arg --logappend "${mongodHackedArgs[@]}"

pidfile="${TMPDIR:-/tmp}/docker-entrypoint-temp-mongod.pid"
pidfile="$TMPDIR/docker-entrypoint-temp-mongod.pid"
rm -f "$pidfile"
_mongod_hack_ensure_arg_val --pidfilepath "$pidfile" "${mongodHackedArgs[@]}"

"${mongodHackedArgs[@]}" --fork

mongo=( mongo --host 127.0.0.1 --port 27017 --quiet )
mongo=( mongo --host "$TMPDIR/mongodb-27017.sock" --quiet )

# check to see that our "mongod" actually did start up (catches "--help", "--version", MongoDB 3.2 being silly, slow prealloc, etc)
# https://jira.mongodb.org/browse/SERVER-16292
Expand Down