diff --git a/.dockerignore b/.dockerignore index 6e19512..989d80b 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,3 @@ .dockerignore +.git Dockerfile diff --git a/Dockerfile b/Dockerfile index bb05c68..5d8e1b5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,19 +10,22 @@ ARG CC=gcc-9 ARG CXX=g++-9 RUN apt-get update && \ - apt-get install -y autoconf automake libtool pkg-config libgl1-mesa-glx && \ + apt-get install -y autoconf automake libtool pkg-config && \ apt-get install -y gcc-9 g++-9 && \ apt-get install -y cmake git wget && \ apt-get install -y libarmadillo-dev && \ apt-get install -y libcfitsio-dev && \ apt-get install -y libfftw3-dev && \ + apt-get install -y libgl1 && \ apt-get install -y libgsl-dev && \ apt-get install -y libsharp-dev && \ apt-get install -y libhealpix-cxx-dev && \ apt-get install -y healpy-data && \ + apt-get install -y python3 python3-pip python3-venv && \ apt-get clean -RUN wget https://github.com/catchorg/Catch2/archive/refs/tags/v3.1.0.tar.gz && \ +RUN cd /home && \ + wget https://github.com/catchorg/Catch2/archive/refs/tags/v3.1.0.tar.gz && \ tar -xvf v3.1.0.tar.gz && \ cd Catch2-3.1.0 && \ cmake -Bbuild -H. -DBUILD_TESTING=OFF && \ @@ -30,27 +33,26 @@ RUN wget https://github.com/catchorg/Catch2/archive/refs/tags/v3.1.0.tar.gz && \ ENV HEALPIX /usr/share/healpy -RUN wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh && \ - bash Miniconda3-latest-Linux-x86_64.sh -b -p /miniconda && \ - rm Miniconda3-latest-Linux-x86_64.sh - -ENV PATH /miniconda/bin:${PATH} - -RUN conda create -n sparse2d python=3.10 pip -y +RUN python3 -m venv /venv -ENV PATH /miniconda/envs/sparse2d/bin:${PATH} +RUN source /venv/bin/activate && \ + pip install --upgrade pip -RUN pip install pybind11 jupyter +RUN source /venv/bin/activate && \ + pip install jupyter COPY . /home -RUN cd /home && \ +RUN source /venv/bin/activate && \ + cd /home && \ mkdir build && \ cd build && \ cmake .. && \ - make && \ + make -j8 && \ make install ENV PYTHONPATH /home/build/src +RUN echo "source /venv/bin/activate" >> ~/.bashrc + RUN echo -e '#!/bin/bash\njupyter notebook --port=8888 --no-browser --ip=0.0.0.0 --allow-root' > /usr/bin/notebook && chmod +x /usr/bin/notebook diff --git a/README.md b/README.md index 745c43e..7271114 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,9 @@ docker pull ghcr.io/cosmostat/sparse2d:master No further installation is required. +> Note that you will need to [log in](https://docs.docker.com/reference/cli/docker/login/) to the GitHub Container Registry. +> `docker login ghcr.io` + ### Run a Docker container To run a container on data in your current working directory, simply run: