Allow having multiple toolbox containers from the same image

This adds a --container flag that overrides the default name of the
toolbox container.
This commit is contained in:
Debarshi Ray 2018-10-16 19:07:41 +02:00
parent 80f25c6924
commit 5739d4b2a9

View file

@ -179,8 +179,8 @@ exit_if_unrecognized_option()
usage()
{
echo "Usage: $0 [--release <release>] [-v | --verbose] create [--candidate-registry]"
echo " or: $0 [--release <release>] [-v | --verbose] enter"
echo "Usage: $0 [--container <name>] [--release <release>] [-v | --verbose] create [--candidate-registry]"
echo " or: $0 [--container <name>] [--release <release>] [-v | --verbose] enter"
echo " or: $0 --help"
}
@ -189,6 +189,15 @@ exec 42>/dev/null
while [[ "$1" == -* ]]; do
case $1 in
--container )
shift
if [ "$1" == "" ]; then
echo "$0: missing argument for '--container'"
echo "Try '$0 --help' for more information."
exit 1
fi
toolbox_container=$1
;;
-h | --help )
usage
exit
@ -225,7 +234,7 @@ while [[ "$1" == -* ]]; do
done
fgc="f$release"
toolbox_container="fedora-toolbox-$USER:$release"
[ "$toolbox_container" == "" ] && toolbox_container="fedora-toolbox-$USER:$release"
base_toolbox_image="fedora-toolbox:$release"
toolbox_image="fedora-toolbox-$USER:$release"