-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgenerate_EEGprep_images.sh
55 lines (49 loc) · 1.76 KB
/
generate_EEGprep_images.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
43
44
45
46
47
48
49
50
51
52
53
54
55
#Generate Dockerfile.
#!/bin/sh
set -e
# Generate Dockerfile.
generate_docker() {
docker run --rm kaczmarj/neurodocker:0.5.0 generate docker \
--base neurodebian:stretch-non-free \
--pkg-manager apt \
--freesurfer version=6.0.0 min=true \
--miniconda \
conda_install="python=3.6 numpy nipype nibabel pandas mne" \
create_env='eegprep' \
activate=true
}
generate_singularity() {
docker run --rm kaczmarj/neurodocker:0.5.0 generate singularity \
--base neurodebian:stretch-non-free \
--pkg-manager apt \
--freesurfer version=6.0.0 min=true \
--install fsl-complete git num-utils gcc \
--miniconda \
conda_install="python=3.6 numpy nipype nibabel pandas mne" \
create_env='eegprep' \
activate=true
}
# generate files
generate_docker > Dockerfile
generate_singularity > Singularity
# check if images should be build locally or not
if [ '$1' = 'local' ]; then
if [ '$2' = 'docker' ]; then
echo "docker image will be build locally"
# build image using the saved files
docker build -t eegprep:test .
elif [ '$2' = 'singularity']; then
echo "singularity image will be build locally"
# build image using the saved files
singularity build eegprep.simg Singularity
elif [ '$2' = 'both' ]; then
echo "docker and singularity images will be build locally"
# build images using the saved files
docker build -t eegprep:test .
singularity build eegprep.simg Singularity
elif [ -z "$2" ]; then
echo "Please indicate which image should be build. You can choose from docker, singularity or both."
fi
else
echo "Image(s) won't be build locally."
fi