Hands-on #2
Singularity configuration file
We will build a container image for LAMMPS code using CentOS as the base image. A template Singularity configuration file is shown below:
Create/use the lammps template configuration file
lammps.cfg
# Header
BootStrap:
OSVersion:
MirrorURL:
Include:
# Sections
%setup
%post
%runscriptHeader
We will BootStrap CentOS version 7 with package manager yum. The MirrorURL for downloading CentOS is http://mirror.centos.org/centos-%{OSVERSION}/%{OSVERSION}/os/$basearch/. Include: yum.
Sections
In this example, we will use %setup, %post and %runscript.
Download and copy LAMMPS to
/opt. Use$SINGULARITY_ROOTFSto access root file system in the container:
Install development tools:
yum -y groupinstall "Development Tools"Configure and compile LAMMPS
Configure the container to run
lmp_serialon execution of the container:
Creating the container image
Create a container called
lammpsand modify the size to 2048 MiB.
Build the lammps configuration file created in the previous step.
Note Building step requires
rootaccess.
Running the container image
To execute the container
Last updated