Skip to content

Commit 792cd39

Browse files
committed
feat(docker): allow overriding config file for docker image
1 parent b97a9aa commit 792cd39

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

docker/witnet-rust/runner.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#!/bin/bash
22

3+
WITNET_FOLDER="/.witnet"
4+
CONFIG_FILE_FROM_CMD=$(echo "$@" | sed -E 's/(.*-c\s*)?(.*\.toml)?.*/\2/')
5+
CONFIG_FILE=${CONFIG_FILE_FROM_CMD:-$WITNET_FOLDER/config/witnet.toml}
6+
COMMAND=$(echo "$@" | sed -E 's/(.*-c\s*)?(.*\.toml)?//')
7+
38
ERROR_BANNER="
49
510
██████╗██████╗ █████╗ ███████╗██╗ ██╗██╗
@@ -52,6 +57,6 @@ while true; do
5257

5358
# Run the node itself, using configuration from the default directory and passing down any arguments that may be
5459
# appended when running "docker run"
55-
RUST_LOG=witnet=$LOG_LEVEL /tmp/witnet-raw -c /.witnet/config/witnet.toml "$@" || echo "$ERROR_BANNER"
60+
RUST_LOG=witnet=$LOG_LEVEL /tmp/witnet-raw -c "$CONFIG_FILE" "$COMMAND" || echo "$ERROR_BANNER"
5661
sleep 30
5762
done

0 commit comments

Comments
 (0)