Skip to content

Commit

Permalink
Removed one step in docker image creation, INSTALL now describes how …
Browse files Browse the repository at this point in the history
…to use docker container
  • Loading branch information
Andrej Dundovic committed Jan 12, 2024
1 parent a00c6a8 commit b008a99
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,12 @@ RUN mamba install --yes \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}"

# Install facets package which does not have a `pip` or `conda-forge` package at the moment
WORKDIR /tmp
RUN git clone https://github.com/cosmicrays/hermes.git
WORKDIR /tmp/hermes
ENV PATH /opt/conda/bin:$PATH
RUN /bin/bash -c "source activate base"
RUN mkdir build && \
WORKDIR /tmp
RUN git clone https://github.com/cosmicrays/hermes.git && \
cd hermes && \
mkdir build && \
cd build && \
CMAKE_PREFIX_PATH=${CONDA_DIR} cmake \
-DPython3_EXECUTABLE=${CONDA_DIR}/bin/python${PYTHON_VERSION} \
Expand Down
19 changes: 19 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,22 @@ Finally, make the library and test executables:
make -j
make install
```

## Install with Docker/Podman image

The simplest, yet the most inflexible method of installation and usage is with [Docker](https://www.docker.com) or [Podman](https://podman.io). One has to install Docker or Podman first on their operating system (GNU/Linux, macOS, Windows are supported).

To build an image based on [Jupyter Docker Stacks](https://jupyter-docker-stacks.readthedocs.io/en/latest/index.html) with HERMES installed and enabled, one has to run

```sh
docker build -t jupyter-pyhermes .
```

Finally, the Jupyter notebook server is started within a new container

```sh
docker run --name jupyter -it --rm -p 8888:8888 -v $HOME/jupyter-work:/home/jovyan/work localhost/jupyter-pyhermes:latest
```

where `$HOME/jupyter-work` is any directory on the host in which notebooks and files can be stored permanently, after the container is stopped and removed. It is linked to the `work` folder within the container.

0 comments on commit b008a99

Please sign in to comment.