diff --git a/Installer.sh b/Installer.sh index 0bed1a9..0e06870 100755 --- a/Installer.sh +++ b/Installer.sh @@ -17,9 +17,9 @@ do shift 2 ;; -h | --help) - echo -e "This is a script to build standalone docker-isis5-asp3-gispy + jupyter lab or jupyterhub with dockerspawner isis5asp3-gispy: + echo -e "This is a script to build standalone docker-isis5-asp3-gispy + jupyter lab or jupyterhub with dockerspawner isis5asp3-gispy:lab: \nDefaut JUPYTERHUB+dockerspawner! - \n-n to install Standalone" + \n'-jhub -n' to install Standalone" exit 2 ;; --) @@ -54,6 +54,7 @@ if [[ $jhub =~ ^[Yy1]$ ]] sleep 2 ./scripts/ImageBuilder.sh docker-compose --f docker-compose.yml --env-file .env build + else ./scripts/ImageBuilder.sh fi diff --git a/scripts/ImageBuilder.sh b/scripts/ImageBuilder.sh index a1413a5..339a465 100755 --- a/scripts/ImageBuilder.sh +++ b/scripts/ImageBuilder.sh @@ -1,24 +1,25 @@ #!/bin/bash -gispy="y" -SHORT=G:,g:,h -LONG=GISPY:,gispy:,help +jupyter="y" +SHORT=J:,j:,G:,g:,h +LONG=JUPYTER:,jupyter:,help OPTS=$(getopt -a -n jupyterhub --options $SHORT --longoptions $LONG -- "$@") eval set -- "$OPTS" while : do case "$1" in - -G | --JUPYTER ) - gispy="$2" + -J | --JUPYTER ) + jupyter="$2" shift 2 ;; - -g | --jupyter ) - gispy="$2" + -j | --jupyter ) + jupyter="$2" shift 2 ;; -h | --help) echo -e "This is a script to build docker-isis-asp + jupyter: - \n-j to install jupyter - default: $gispy" + \n-j to install jupyter - default: $jupyter + \n-g to install gispy - default: $gispy" exit 2 ;; --) @@ -44,23 +45,25 @@ ISIS_IMAGE="isis5-asp3:base" echo "ISIS version $ISIS_VERSION will be installed" echo "NASA_Ames Stereo Pipeline 3.0.0 will be installed" -echo "GIS-python install: $gispy" +echo "Jupyter + GIS-python install: $jupyter" -if [[ $jupyter =~ ^[Yy1]$ ]] - then - JUPYTER_GISPY_IMAGE="jupyter-gispy:gdal" - docker build -t "$JUPYTER_GISPY_IMAGE" \ - -f $PWD/dockerfiles/$GISPY_DOCKERFILE . - BASE_IMAGE=$JUPYTER_GISPY_IMAGE - ISIS_IMAGE="isis5-asp3-gispy:lab" - else - JUPYTER_ENABLE_LAB='no' -fi + if [[ $jupyter =~ ^[Yy1]$ ]] + then + BASE_IMAGE="jupyter/base-notebook:lab-3.2.8" + JUPYTER_GISPY_IMAGE="jupyter-gispy:gdal" + docker build -t "$JUPYTER_GISPY_IMAGE" \ + --build-arg BASE_IMAGE="$BASE_IMAGE" \ + -f $PWD/dockerfiles/$GISPY_DOCKERFILE . + BASE_IMAGE=$JUPYTER_GISPY_IMAGE + ISIS_IMAGE="isis5-asp3-gispy:lab" + else + JUPYTER_ENABLE_LAB='no' + fi -echo "Creating $ISIS_IMAGE image" -docker build -t "$ISIS_IMAGE" \ - --build-arg BASE_IMAGE="$BASE_IMAGE" \ - --build-arg ISIS_VERSION="$ISIS_VERSION" \ - --build-arg ASP_VERSION="$ASP_VERSION" \ - -f $PWD/dockerfiles/$DOCKERFILE . -[ $? ] && echo "Docker image $ISIS_IMAGE built." + echo "Creating $ISIS_IMAGE image" + docker build -t "$ISIS_IMAGE" \ + --build-arg BASE_IMAGE="$BASE_IMAGE" \ + --build-arg ISIS_VERSION="$ISIS_VERSION" \ + --build-arg ASP_VERSION="$ASP_VERSION" \ + -f $PWD/dockerfiles/$DOCKERFILE . + [ $? ] && echo "Docker image $ISIS_IMAGE built."