summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcontrib/bst-here20
1 files changed, 15 insertions, 5 deletions
diff --git a/contrib/bst-here b/contrib/bst-here
index 51a6252d1..5b2451848 100755
--- a/contrib/bst-here
+++ b/contrib/bst-here
@@ -25,16 +25,22 @@
usage() {
cat <<EOF
-USAGE: $(basename "$0") [-i BST_HERE_IMAGE] [-p] [-t] [-T] [-v VOLUME ...] [-h] [COMMAND [ARG..]]
+USAGE: $(basename "$0") [-i BST_HERE_IMAGE] [-j TAG] [-p] [-t] [-T] [-v VOLUME ...] [-h] [COMMAND [ARG..]]
Run a bst command in a new BuildStream container.
If no command is specified, an interactive shell is launched
using "/bin/bash -i".
+See https://hub.docker.com/r/buildstream/buildstream for details on image
+variants.
+
OPTIONS:
-i IMAGE Specify Docker image to use; can also be specified by setting
BST_HERE_IMAGE environment variable.
+ (default: buildstream/buildstream)
+ -j TAG Specify the tag of the Docker image to use.
+ (default: latest)
-p Pull the latest buildstream image before running.
-t Force pseudo-terminal allocation.
-T Disable pseudo-terminal allocation.
@@ -46,7 +52,8 @@ EOF
exit "$1"
}
-bst_here_image="${BST_HERE_IMAGE:-buildstream/buildstream:latest}"
+bst_here_image="${BST_HERE_IMAGE:-buildstream/buildstream}"
+bst_here_tag=latest
is_tty=
update=false
@@ -57,12 +64,15 @@ then
is_tty=y
fi
-while getopts i:ptTv:h arg
+while getopts i:j:ptTv:h arg
do
case $arg in
i)
bst_here_image="$OPTARG"
;;
+ j)
+ bst_here_tag="$OPTARG"
+ ;;
p)
update=true
;;
@@ -101,7 +111,7 @@ fi
if "$update" == true
then
- docker pull "$bst_here_image"
+ docker pull "$bst_here_image:$bst_here_tag"
fi
# FIXME: We run with --privileged to allow bwrap to mount system
@@ -122,5 +132,5 @@ exec docker run --rm -i${is_tty:+ -t} \
--volume "$PWD":/src \
$extra_volumes_opt \
--workdir /src \
- "$bst_here_image" \
+ "$bst_here_image:$bst_here_tag" \
$command