JohannesWiesner / csp_docker

A repository for creating Docker and Singularity files using Neurodocker
0 stars 1 forks source link

Add generic script to start container #6

Open JohannesWiesner opened 2 years ago

JohannesWiesner commented 2 years ago

Add a script that allows you to run the image as a container both on Windows (Docker) and Linux (Singularity). Paths should be replaced with variables that the user can set. csp_image_run.sh:

if [[ "$OSTYPE" == "linux-gnu"* ]]; then
    singularity run -B /zi-flstorage/group_csp/analyses/johannes.wiesner/projects/hcp_project/code/:/home/neuro/workdir \
    -B /zi-flstorage/group_csp/open_access_datasets/humanconnectome/raw_data/:/data \
    -B /zi-flstorage/group_csp/open_access_datasets/humanconnectome/derivatives/:/output \
    /csp-tools/singularity_images/csp.sif jupyter-lab --notebook-dir=/home/neuro/workdir
elif [[ "$OSTYPE" == "msys" ]]; then
    winpty docker run -it --rm -v /C:/Users/Johannes.Wiesner/Documents/projects/hcp_project/code/:/home/neuro/workdir \
    -v /C:/Users/Johannes.Wiesner/Documents/projects/hcp_project/data/humanconnectome/raw_data/:/data \
    -v /C:/Users/Johannes.Wiesner/Documents/projects/hcp_project/data/humanconnectome/derivatives/:/output \
    -p 8888:8888 johanneswiesner/csp:1.0.0 jupyter lab
fi