sanchezivan/singularity_image_recipes:hello_world

$ singularity pull shub://sanchezivan/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/sanchezivan-singularity_image_recipes-hello_world
collection name sanchezivan/singularity_image_recipes
branch master
tag hello_world
commit 838665c3185212b4e6516ceb326dcc5587c5b931
version (container hash) 17aae7a5dffdf7fc6b5fac629d2a9028
build date 2019-05-25T06:40:09.488Z
size (MB) 601
size (bytes) 196292639
SIF Download URL (please use pull with shub://)
Datalad URL View on Datalad
Singularity Recipe Singularity Recipe on Datalad
We cannot guarantee that all containers will still exist on GitHub.