diff --git a/Makefile b/Makefile index 2d4e623..cc081b7 100644 --- a/Makefile +++ b/Makefile @@ -48,3 +48,8 @@ test_fastjet: --volume $(shell pwd):/work \ matthewfeickert/pythia-python:latest \ 'g++ tests/test_FastJet.cc -o tests/test_FastJet $$(fastjet-config --cxxflags --libs --plugins); ./tests/test_FastJet' + +binder_repo2docker: + repo2docker \ + --image-name matthewfeickert/pythia-python:binder \ + . diff --git a/README.md b/README.md index 54f333e..9d48093 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Docker Pulls](https://img.shields.io/docker/pulls/matthewfeickert/pythia-python)](https://hub.docker.com/r/matthewfeickert/pythia-python) [![Docker Image Size (tag)](https://img.shields.io/docker/image-size/matthewfeickert/pythia-python/latest)](https://hub.docker.com/r/matthewfeickert/pythia-python/tags?name=latest) +[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/matthewfeickert/pythia-python/HEAD) > PYTHIA is a program for the generation of high-energy physics events, i.e. for the description of collisions at high energies between elementary particles such as e+, e-, p and pbar in various combinations. diff --git a/binder/Dockerfile b/binder/Dockerfile new file mode 100644 index 0000000..76a9545 --- /dev/null +++ b/binder/Dockerfile @@ -0,0 +1,40 @@ +FROM matthewfeickert/pythia-python:pythia8.308 + +# Remove existing non-root user "docker" with uid 1000 +# to avoid conflict with jovyan +USER root +RUN deluser docker + +ARG NB_USER=jovyan +ARG NB_UID=1000 +ENV USER ${NB_USER} +ENV NB_UID ${NB_UID} +ENV HOME /home/${NB_USER} + +USER root +RUN adduser --disabled-password \ + --gecos "Default user" \ + --uid ${NB_UID} \ + ${NB_USER} +USER ${NB_USER} + +# FIXME: Downgrade jupyter-server to contend with: +# https://github.com/jupyterhub/repo2docker/issues/1231 +# https://github.com/jupyter-server/jupyter_server/issues/1038 +RUN python -m pip --no-cache-dir install --upgrade \ + notebook \ + jupyterlab \ + jupyterhub \ + 'jupyter-server<2.0.0' + +# Make sure the contents of the repo are in ${HOME} +COPY . ${HOME} +USER root +RUN chown -R ${NB_UID} ${HOME} && \ + chown -R ${NB_UID} /usr/local/venv +USER ${NB_USER} +WORKDIR ${HOME} + +# Null out ENTRYPOINT and CMD to let repo2docker control them +ENTRYPOINT [ ] +CMD [ ]