singularity镜像创建与使用

首先贴上官方文档,Singularity是一个类似与docker的软体,它允许你创建容器并复制到另一主机中利用宿主机的资源运行,这里只简单列出一些常用的命令。

安装

Ubuntu:

sudo apt-get update && sudo apt-get install python dh-autoreconf build-essential

Centos:

sudo yum update && sudo yum groupinstall 'Development Tools'

# clone可以选择release版本进行安装
$ git clone https://github.com/singularityware/singularity.git
$ cd singularity
$ ./autogen.sh
$ ./configure --prefix=/usr/local --sysconfdir=/etc
$ make
$ sudo make install

创建容器

singularity build containerName.simg Singularity

其中,Singularity是对应的build脚本。

进入容器里面

singularity shell -n containerName.simg

共享文件

singularity shell -B /masterFolder:/containerFolder containerName.simg

参考博客:张洋洋

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.