This is an automated email from the ASF dual-hosted git repository.
sanirudh 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 1ca444ebb9 [Docker] Add build.sh environment variables (#15095)
1ca444ebb9 is described below
commit 1ca444ebb939fb907c4295c93c512f3637b156ea
Author: Liam Sturge <[email protected]>
AuthorDate: Thu Jun 15 03:37:18 2023 +0100
[Docker] Add build.sh environment variables (#15095)
Add build.sh environment variables
Change to build.sh to be able to pass environment variables to a
container in a similar fashion to bash.sh.
---
docker/build.sh | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/docker/build.sh b/docker/build.sh
index 123365c8f0..8776bdeb0d 100755
--- a/docker/build.sh
+++ b/docker/build.sh
@@ -22,6 +22,7 @@
#
# Usage: build.sh <CONTAINER_TYPE> [--tag <DOCKER_IMAGE_TAG>]
# [--dockerfile <DOCKERFILE_PATH>] [-it]
+# [--env <ENVIRONMENT_VARIABLE>]
# [--net=host] [--cache-from <IMAGE_NAME>] [--cache]
# [--name CONTAINER_NAME] [--context-path <CONTEXT_PATH>]
# [--spec DOCKER_IMAGE_SPEC]
@@ -44,6 +45,8 @@
# DOCKER_IMAGE_SPEC: Override the default logic to determine the image name and
# tag
#
+# ENVIRONMENT_VARIABLE: Pass any environment variables through to the
container.
+#
# IMAGE_NAME: An image to be as a source for cached layers when building the
# Docker image requested.
#
@@ -76,6 +79,12 @@ if [[ "$1" == "--dockerfile" ]]; then
shift 2
fi
+if [[ "$1" == "--env" ]]; then
+ ENVIRONMENT_VARIABLE="$2"
+ echo "Setting environment variable: $ENVIRONMENT_VARIABLE"
+ shift 2
+fi
+
if [[ "$1" == "-it" ]]; then
CI_DOCKER_EXTRA_PARAMS+=('-it')
shift 1