-
Notifications
You must be signed in to change notification settings - Fork 0
/
mount_image.sh
executable file
·42 lines (38 loc) · 1.53 KB
/
mount_image.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
################################################################################
# Help #
################################################################################
set -e
Help()
{
# Display Help
echo -e "\nThis script mounts the AsiteDesign Singularity Image"
echo "Must have installed:"
echo " 1. docker"
echo " 2. singularity"
echo -e "\n! This script have to be in the same folder as the dockerfile !\n"
echo "Syntax: ./mount_image.sh [-|h|u|p]"
echo "options:"
echo "-h Print this Help."
echo
}
################################################################################
################################################################################
# Main program #
################################################################################
################################################################################
# Get the options
while getopts "h" option; do
case $option in
h) # display Help
Help
exit;;
esac
done
# Get user and password
read -p "Rosetta User: " user
read -s -p "Rosetta Password: " pass
echo -e "\n################# Building docker image #################\n"
sudo docker build --build-arg USER=$user --build-arg PASS=$pass -t asitedesign:latest .
echo -e "\n################# Creating singularity image #################\n"
sudo singularity build asitedesign.sif docker-daemon://asitedesign:latest