mrobbert/singularity_image_recipes:hello_world
$ singularity pull shub://mrobbert/singularity_image_recipes:hello_world
Singularity Recipe
Bootstrap: docker
From: centos
%setup
# setup is run after the base 'centos' image is
# downloaded and upacked but before entering the
# container environment
# this is the path on the local system to
# what will become your container's root directory
echo ${SINGULARITY_ROOTFS}
# create a directory for your application
mkdir ${SINGULARITY_ROOTFS}/myapp
# copy the hello world example from the github to
# the app directory
cp example_codes/hello_world.cpp ${SINGULARITY_ROOTFS}/myapp/
%post
# post is run after entering the container env.
# need to install some development tools to
# build our code
yum update -y
yum groupinstall -y "Development Tools"
yum install -y gcc g++
# enter directory where source file was copied
cd /myapp
# build
g++ -o hello_world hello_world.cpp
%runscript
# run script
/myapp/hello_world
%environment
# can define runtime environment variables here
# these vars will be set during calls to 'shell'
# or 'exec' or 'run' but will not be set during
# the previous 'post' section of the recipe file
# so, if you need them, define them there as well
export PATH=$PATH:/myapp
Collection
View on Datalad
Metrics
key | value |
---|---|
id | /containers/mrobbert-singularity_image_recipes-hello_world |
collection name | mrobbert/singularity_image_recipes |
branch | master |
tag | hello_world |
commit | 6beb630d2e25911679cdd2d045a4cb3443d18ac4 |
version (container hash) | cd4566a63358be0d693176b66d324f00 |
build date | 2019-03-07T01:18:17.761Z |
size (MB) | 585 |
size (bytes) | 189927455 |
SIF | Download URL (please use pull with shub://) |
Datalad URL | View on Datalad |
Singularity Recipe | Singularity Recipe on Datalad |
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.