This is an automated email from the ASF dual-hosted git repository.
tqchen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git
The following commit(s) were added to refs/heads/main by this push:
new 43c61a2 add the --net=host cmd line arg to the docker/bash.it script
(#7780)
43c61a2 is described below
commit 43c61a2d0a08fe60386e0d8b80e00d8c75253135
Author: Mher Kazandjian <[email protected]>
AuthorDate: Fri Apr 2 16:28:10 2021 +0200
add the --net=host cmd line arg to the docker/bash.it script (#7780)
---
docker/bash.sh | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/docker/bash.sh b/docker/bash.sh
index 51fb682..3c4be21 100755
--- a/docker/bash.sh
+++ b/docker/bash.sh
@@ -20,6 +20,8 @@
#
# Start a bash, mount /workspace to be current directory.
#
+# Usage: bash.sh <CONTAINER_TYPE> [-i] [--net=host] <CONTAINER_NAME> <COMMAND>
+#
# Usage: docker/bash.sh <CONTAINER_NAME>
# Starts an interactive session
#
@@ -38,8 +40,14 @@ if [ "$1" == "-i" ]; then
shift
fi
+CI_DOCKER_EXTRA_PARAMS=( )
+if [[ "$1" == "--net=host" ]]; then
+ CI_DOCKER_EXTRA_PARAMS+=('--net=host')
+ shift 1
+fi
+
if [ "$#" -lt 1 ]; then
- echo "Usage: docker/bash.sh [-i] <CONTAINER_NAME> [COMMAND]"
+ echo "Usage: docker/bash.sh [-i] [--net=host] <CONTAINER_NAME> [COMMAND]"
exit -1
fi
@@ -48,16 +56,15 @@ if [ -z "${DOCKER_IMAGE_NAME}" ]; then
DOCKER_IMAGE_NAME=("$1")
fi
-CI_DOCKER_EXTRA_PARAMS=( )
if [ "$#" -eq 1 ]; then
COMMAND="bash"
interactive=1
if [[ $(uname) == "Darwin" ]]; then
# Docker's host networking driver isn't supported on macOS.
# Use default bridge network and expose port for jupyter notebook.
- CI_DOCKER_EXTRA_PARAMS=( "${CI_DOCKER_EXTRA_PARAMS[@]}" "-p 8888:8888"
)
+ CI_DOCKER_EXTRA_PARAMS+=( "${CI_DOCKER_EXTRA_PARAMS[@]}" "-p
8888:8888" )
else
- CI_DOCKER_EXTRA_PARAMS=( "${CI_DOCKER_EXTRA_PARAMS[@]}" "--net=host" )
+ CI_DOCKER_EXTRA_PARAMS+=( "${CI_DOCKER_EXTRA_PARAMS[@]}" "--net=host" )
fi
else
shift 1