# 이미지 생성(build) - (docker 의 pull 과 동일함.) / .simg == Singularity Image
singularity build ~/tf-1.11-gpu-py3.simg docker://tensorflow/tensorflow:1.11.0-gpu-py3
# 다운로드 된 이미지 파일 확인.
ll -trh ~/tf-1.11-gpu-py3.simg
file ~/tf-1.11-gpu-py3.simg
# 이미지 실행(exec) (singularity 의 경우 home 디렉토리는 기본으로 mount 됩니다.)
singularity exec ~/tf-1.11-gpu-py3.simg pwd
singularity exec ~/tf-1.11-gpu-py3.simg ls -l
singularity exec ~/tf-1.11-gpu-py3.simg pip list | grep tensor
# 코드 실행. (--nv 옵션 = GPU 사용)
singularity exec --nv ~/tf-1.11-gpu-py3.simg \
python ~/TensorFlow-Examples/examples/3_NeuralNetworks/neural_network_raw.py
# 볼륨 마운트 (예를 들어. /datasets)
singularity exec --nv -B /datasets:/datasets ~/tf-1.11-gpu-py3.simg ls -l /datasets