@@ -44,8 +44,9 @@ function usage() {
4444
4545 Image Format
4646 --folder -f build development sandbox (folder)
47+ --option -o add a custom option to build (-o --fakeroot or -option 'section post' )
4748 --writable -w non-production writable image (ext3)
48- Default is squashfs (recommended)
49+ Default is squashfs (recommended) (deprecated)
4950 --name -n provide basename for the container (default based on URI)
5051 --mount -m provide list of custom mount points (in quotes!)
5152 --help -h show this help and exit
6162mount_points=" /oasis /projects /scratch /local-scratch /work /home1 /corral-repl /corral-tacc /beegfs /share/PI /extra /data /oak"
6263image_format=" squashfs"
6364new_container_name=" "
65+ options=" "
6466
6567while true ; do
6668 case ${1:- } in
@@ -78,6 +80,11 @@ while true; do
7880 mount_points=" ${1:- } "
7981 shift
8082 ;;
83+ -o|--option)
84+ shift
85+ options=" ${1:- } ${options} "
86+ shift
87+ ;;
8188 -f|--folder)
8289 shift
8390 image_format=" sandbox"
107114
108115image=${1}
109116
117+ exit 0
110118echo " "
111119echo " Image Format: ${image_format} "
112120echo " Docker Image: ${image} "
@@ -311,11 +319,11 @@ docker rm $container_id >> /dev/null
311319# Build a final image from the sandbox
312320echo " (9/10) Building ${image_format} container..."
313321if [ " $image_format " == " squashfs" ]; then
314- new_container_name=${new_container_name} .simg
315- singularity build ${new_container_name} $build_sandbox
322+ new_container_name=${new_container_name} .sif
323+ singularity build ${options} ${ new_container_name} $build_sandbox
316324elif [ " $image_format " == " writable" ]; then
317- new_container_name=${new_container_name} .img
318- singularity build --writable ${new_container_name} $build_sandbox
325+ new_container_name=${new_container_name} .simg
326+ singularity build ${options} --writable ${new_container_name} $build_sandbox
319327else
320328 mv $build_sandbox $new_container_name
321329fi
0 commit comments