Skip to content

Instantly share code, notes, and snippets.

@vsoch
Last active August 17, 2020 17:23
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vsoch/502267875c330ab37571bc532061edfc to your computer and use it in GitHub Desktop.
Save vsoch/502267875c330ab37571bc532061edfc to your computer and use it in GitHub Desktop.
Singularity image with anaconda + R
git clone -b development https://www.github.com/singularityware/singularity.git
cd singularity
./autogen.sh
./configure --prefix=/usr/local
make
sudo make install
cd $HOME #or wherever you want :)
singularity create --size 8000 rpython.img
sudo singularity bootstrap rpython.img Singularity
# Then run
./rpython.img
null device
1
# test.jpg in $PWD
From:rocker/ropensci
Bootstrap:docker
%environment
PATH=$PATH:/opt/anaconda3/bin
export PATH
%runscript
Rscript /code/runman.R
%post
apt-get update &&
apt-get -y install git bzip2
wget https://repo.continuum.io/archive/Anaconda3-4.2.0-Linux-x86_64.sh
bash Anaconda3-4.2.0-Linux-x86_64.sh -b -p /opt/anaconda3
echo "PATH=/opt/anaconda3/bin:\$PATH" >> $HOME/.bashrc
echo "export PATH" >> $HOME/.bashrc
rm Anaconda3-4.2.0-Linux-x86_64.sh
. $HOME/.bashrc
/opt/anaconda3/bin/conda install -c r r-essentials
mkdir /code
cat << EOF > /code/runman.R
jpeg("test.jpg")
hist(c(1, 4, 1, 4, 5, 6, 7, 1, 3, 5, 2))
dev.off()
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment