Added dockerfile for building singularity-images.
This commit is contained in:
parent
bff53c583e
commit
8903d6c896
|
@ -0,0 +1,16 @@
|
|||
FROM archlinux/base
|
||||
|
||||
ARG version=2.6.1
|
||||
|
||||
RUN curl -o /etc/pacman.d/mirrorlist "https://www.archlinux.org/mirrorlist/?country=GB&protocol=https&use_mirror_status=on" &&\
|
||||
sed -i 's/^#//' /etc/pacman.d/mirrorlist &&\
|
||||
pacman --noconfirm -Syyu base-devel wget python squashfs-tools debootstrap
|
||||
|
||||
RUN mkdir /tmp/singularity &&\
|
||||
cd /tmp/singularity &&\
|
||||
wget "https://github.com/singularityware/singularity/releases/download/${version}/singularity-${version}.tar.gz" &&\
|
||||
tar -xvzf singularity-${version}.tar.gz &&\
|
||||
cd singularity-${version} &&\
|
||||
./configure --prefix=/usr/local &&\
|
||||
make &&\
|
||||
sudo make install
|
|
@ -0,0 +1,20 @@
|
|||
#!/usr/bin/bash
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
|
||||
if [ "$#" -lt 2 ]; then
|
||||
echo "Usage: $0 <IMGFILE> <DEFFILE>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
IMGFILE=$(realpath $1)
|
||||
IMGDIR=$(dirname "$IMGFILE")
|
||||
DEFFILE=$(realpath $2)
|
||||
DEFDIR=$(dirname "$DEFFILE")
|
||||
|
||||
if [ -f "$IMGFILE" ]; then
|
||||
rm "$IMGFILE"
|
||||
fi
|
||||
|
||||
docker build --tag=singularitybuilder-arch -f singularitybuilder-arch.Dockerfile .
|
||||
docker run -v "$IMGDIR:$IMGDIR" -v "$DEFDIR:$DEFDIR" --privileged singularitybuilder-arch:latest singularity build "$IMGFILE" "$DEFFILE"
|
Loading…
Reference in New Issue