Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.dockerignore
.git
Dockerfile
28 changes: 15 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,47 +10,49 @@ 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 && \
cmake --build build/ --target install

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
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading