Set debug mode according to ENABLE_DEBUG_LOG_LEVEL

Docker turn off debug mode by default, but the non-debug mode
doesn't provide enough information for development. It is handy
to have a way to turn on the debug mode.

Change-Id: I403ea7cc43b0b0808bfac3ec6f9ac7586f4723f6
This commit is contained in:
Hongbin Lu 2017-09-27 21:35:02 +00:00
parent b8f4f066ba
commit 718e499466
1 changed files with 7 additions and 0 deletions

View File

@ -83,10 +83,17 @@ function configure_docker {
cluster_store_opts+="\"cluster-store\": \"$DOCKER_CLUSTER_STORE\"," cluster_store_opts+="\"cluster-store\": \"$DOCKER_CLUSTER_STORE\","
fi fi
local docker_config_file=/etc/docker/daemon.json local docker_config_file=/etc/docker/daemon.json
local debug
if [[ "$ENABLE_DEBUG_LOG_LEVEL" == "True" ]]; then
debug=true
else
debug=false
fi
sudo mkdir -p $(dirname ${docker_config_file}) sudo mkdir -p $(dirname ${docker_config_file})
cat <<EOF | sudo tee $docker_config_file >/dev/null cat <<EOF | sudo tee $docker_config_file >/dev/null
{ {
$cluster_store_opts $cluster_store_opts
"debug": ${debug},
"group": "$DOCKER_GROUP", "group": "$DOCKER_GROUP",
"hosts": [ "hosts": [
"unix://$DOCKER_ENGINE_SOCKET_FILE", "unix://$DOCKER_ENGINE_SOCKET_FILE",