Commit f3f7d67f authored by Emeric Verschuur's avatar Emeric Verschuur

Add docker-storage-driver option fir setup

parent 56811862
......@@ -109,11 +109,12 @@ if grep -q '^ *\<DOCKER_OPTS\>' /etc/default/docker; then
fi
_sudo cat /etc/docker/daemon.json |
jq ". + {
\"bip\": \"$CITBX_DOCKER_BIP\",
\"fixed-cidr\": \"$CITBX_DOCKER_FIXED_CIDR\",
\"dns\": $(bashopts_dump_array "string" "${CITBX_DOCKER_DNS_LIST[@]}")
}" | sudo_sponge /etc/docker/daemon.json
jq '. + {
"bip": "'"$CITBX_DOCKER_BIP"'",
"fixed-cidr": "'"$CITBX_DOCKER_FIXED_CIDR"'",
"dns": '"$(bashopts_dump_array "string" "${CITBX_DOCKER_DNS_LIST[@]}")"',
"storage-driver": "'"$CITBX_DOCKER_STORAGE_DRIVER"'"
}' | sudo_sponge /etc/docker/daemon.json
# Add user SSL ROOT CA
if [ -d $CITBX_ABS_DIR/ca-certificates ]; then
......
......@@ -431,13 +431,17 @@ $(for j in "${CITBX_JOB_LIST[@]}"; do echo " $j"; done | sort -u)"
setup)
bashopts_tool_usage="$CITBX_TOOL_NAME $command [arguments...]
=> type '$CITBX_TOOL_NAME help' to display the global help"
bashopts_declare -n CITBX_DOCKER_BIP -l docker-bip -v "192.168.255.254/24" \
-t string -s -i -d "Local docker network IPV4 host adress"
bashopts_declare -n CITBX_DOCKER_FIXED_CIDR -l docker-cdir -v "192.168.255.0/24" \
-t string -s -i -d "Local docker network IPV4 prefix"
bashopts_declare -n CITBX_DOCKER_BIP -l docker-bip -v "$(
val=$(jq -r '.bip' /etc/docker/daemon.json 2> /dev/null || true)
echo ${val:-"192.168.255.254/24"}
)" -t string -i -d "Local docker network IPV4 host adress"
bashopts_declare -n CITBX_DOCKER_FIXED_CIDR -l docker-cdir -v "$(
val=$(jq -r '."fixed-cidr"' /etc/docker/daemon.json 2> /dev/null || true)
echo ${val:-"192.168.255.0/24"}
)" -t string -i -d "Local docker network IPV4 prefix"
bashopts_declare -n CITBX_DOCKER_DNS_LIST -l docker-dns -m add \
-x "($(
if [ "0$(jq -e '.dns | length' /etc/docker/daemon.json 2> /dev/null)" -gt 0 ]; then
if [ "0$(jq -e '.dns | length' /etc/docker/daemon.json 2> /dev/null || true)" -gt 0 ]; then
jq -r '.dns[]' /etc/docker/daemon.json 2> /dev/null | tr '\n' ' '
else
cat /etc/resolv.conf | awk '/^nameserver/ {
......@@ -447,7 +451,12 @@ $(for j in "${CITBX_JOB_LIST[@]}"; do echo " $j"; done | sort -u)"
}'
fi
) )" \
-t string -s -i -d "Docker DNS"
-t string -i -d "Docker DNS"
bashopts_declare -n CITBX_DOCKER_STORAGE_DRIVER -l docker-storage-driver -v "$(
val=$(jq -r '."storage-driver"' /etc/docker/daemon.json 2> /dev/null || true)
echo ${val:-"overlay2"}
)" -e 'o|overlay2' -e 'overlay' -e 'a|aufs' -e 'd|devicemapper' -e 'b|btrfs' -e 'z|zfs' \
-t enum -i -d "Docker storage driver"
;;
update)
;;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment