diff --git a/envs/Dockerfile b/envs/Dockerfile new file mode 100644 index 0000000..61582e1 --- /dev/null +++ b/envs/Dockerfile @@ -0,0 +1,45 @@ +FROM nvidia/cuda:12.1.1-base-ubuntu22.04 +LABEL maintainer="Balázs Ligeti " + +# Avoid prompts from apt +ENV DEBIAN_FRONTEND=noninteractive + +# Install necessary packages +RUN apt-get update && apt-get install -y --no-install-recommends \ + wget \ + unzip \ + lbzip2 \ + mc \ + libgtextutils-dev \ + sudo \ + curl \ + gpg \ + git \ + && rm -rf /var/lib/apt/lists/* + +# Create and switch to the 'prokbert' user before installing Miniconda +RUN useradd -m -s /bin/bash prokbert +USER prokbert +WORKDIR /home/prokbert + +# Install Miniconda as 'prokbert' +RUN mkdir -p /home/prokbert/bin && \ + cd /home/prokbert/bin && \ + wget https://repo.anaconda.com/miniconda/Miniconda3-py311_23.10.0-1-Linux-x86_64.sh && \ + chmod +x Miniconda3-py311_23.10.0-1-Linux-x86_64.sh && \ + ./Miniconda3-py311_23.10.0-1-Linux-x86_64.sh -b -p /home/prokbert/miniconda3 && \ + /home/prokbert/miniconda3/bin/conda init bash && \ + echo "source /home/prokbert/miniconda3/etc/profile.d/conda.sh" >> /home/prokbert/.bashrc + +# Set PATH to include the user's conda and potentially other user-specific binaries +ENV PATH /home/prokbert/miniconda3/bin:$PATH + + +# Use pip to install prokbert and other dependencies +RUN pip install prokbert seaborn umap-learn jupyterlab + +# Set up a work directory for prokbert stuff +RUN git clone https://github.com/nbrg-ppcu/prokbert.git +USER prokbert + +CMD ["/bin/bash"] diff --git a/envs/prokbert.def b/envs/prokbert.def new file mode 100644 index 0000000..eefe0a6 --- /dev/null +++ b/envs/prokbert.def @@ -0,0 +1,48 @@ +Bootstrap: docker +From: nvidia/cuda:12.1.1-base-ubuntu22.04 + +%labels + MAINTAINER Balázs Ligeti + +%environment + DEBIAN_FRONTEND=noninteractive + PATH=/opt/miniconda3/bin:$PATH + +%post + # Install necessary packages + apt-get update && apt-get install -y --no-install-recommends \ + wget \ + unzip \ + lbzip2 \ + mc \ + libgtextutils-dev \ + sudo \ + curl \ + gpg \ + git \ + && rm -rf /var/lib/apt/lists/* + + # Check if Miniconda is already installed; if not, install it + if [ ! -d "/opt/miniconda3" ]; then + echo "Installing Miniconda..." + wget https://repo.anaconda.com/miniconda/Miniconda3-py311_23.10.0-1-Linux-x86_64.sh -O /tmp/miniconda.sh + bash /tmp/miniconda.sh -b -p /opt/miniconda3 + rm /tmp/miniconda.sh + else + echo "/opt/miniconda3 exists. Skipping Miniconda installation." + fi + + echo "source /opt/miniconda3/etc/profile.d/conda.sh" >> $SINGULARITY_ENVIRONMENT + + # Install Python packages + /opt/miniconda3/bin/pip install prokbert seaborn umap-learn jupyterlab + + # Clone the prokbert repository + git clone https://github.com/nbrg-ppcu/prokbert.git /opt/prokbert + +%runscript + # Define what happens when the container is run without specifying a command + exec /opt/miniconda3/bin/python "$@" + +%help + This container includes the prokbert environment with Miniconda and additional Python packages.