additional option support for docker

Signed-off-by: Leo Chen <leo@harmony.one>
pull/2364/head
Leo Chen 5 years ago
parent 6347352fe1
commit cf234feeab
  1. 5
      scripts/docker/docker-node.sh
  2. 8
      scripts/docker/run

@ -22,6 +22,7 @@ options:
-n network : network type -n network : network type
-z dns_zone : dns zone -z dns_zone : dns zone
-d db_dir : harmony db directory -d db_dir : harmony db directory
-X "extra" : extra parameters to docker 'run' script
-k : kill running node -k : kill running node
-h : print this message -h : print this message
@ -46,13 +47,14 @@ fi
kill_only= kill_only=
while getopts "t:p:d:kh" opt; do while getopts "t:p:d:khX:" opt; do
case "$opt" in case "$opt" in
t) tag="$OPTARG" t) tag="$OPTARG"
DOCKER_IMAGE=$DOCKER_REPO:$tag;; DOCKER_IMAGE=$DOCKER_REPO:$tag;;
p) port_base="$OPTARG";; p) port_base="$OPTARG";;
d) db_dir="$OPTARG";; d) db_dir="$OPTARG";;
k) kill_only="true";; k) kill_only="true";;
X) extra="$OPTARG";;
*) usage;; *) usage;;
esac esac
done done
@ -113,6 +115,7 @@ docker run -it -d \
-e NODE_PORT=$port_base \ -e NODE_PORT=$port_base \
-e NODE_BLSKEY=$BLSKEY \ -e NODE_BLSKEY=$BLSKEY \
-e NODE_BLSPASS=$BLSPASS \ -e NODE_BLSPASS=$BLSPASS \
-e NODE_EXTRA_OPTIONS="$extra" \
-v $(realpath ${db_dir}/harmony_db_0):/harmony/harmony_db_0 \ -v $(realpath ${db_dir}/harmony_db_0):/harmony/harmony_db_0 \
-v $(realpath ${db_dir}/harmony_db_1):/harmony/harmony_db_1 \ -v $(realpath ${db_dir}/harmony_db_1):/harmony/harmony_db_1 \
-v $(realpath ${db_dir}/harmony_db_2):/harmony/harmony_db_2 \ -v $(realpath ${db_dir}/harmony_db_2):/harmony/harmony_db_2 \

@ -108,9 +108,13 @@ if [ "$NODE_RPC" == "true" ]; then
) )
fi fi
msg "harmony ${args[@]}" if [ -n "$NODE_EXTRA_OPTIONS" ]; then
extra_args="$NODE_EXTRA_OPTIONS"
fi
msg "harmony ${args[@]} $extra_args"
ls -al ${keydir} ls -al ${keydir}
harmony "${args[@]}" harmony "${args[@]} $extra_args"
# vim: ai ts=2 sw=2 et sts=2 ft=sh # vim: ai ts=2 sw=2 et sts=2 ft=sh

Loading…
Cancel
Save