diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..ca73c9a30366fc55c0d58624e3b63365415f2d2b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,30 @@ +FROM python:3.8-slim-buster + +USER root +WORKDIR /root + +RUN apt-get update && \ + apt-get install -y wget && \ + apt-get install bzip2 + +RUN groupadd --gid 1000 bril && \ + useradd --gid 1000 --uid 1000 -G root bril && \ + echo "bril ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers + +WORKDIR /home/bril + +RUN chown -R bril /home/bril && \ + chmod 755 /home/bril + +USER bril +ENV USER bril +ENV HOME /home/bril + +RUN wget https://cern.ch/cmslumisw/installers/linux-64/Brilconda-1.1.7-Linux-x86_64.sh && \ + bash Brilconda-1.1.7-Linux-x86_64.sh -b -p brilconda + +ENV PATH $HOME/.local/bin:$HOME/brilconda/bin:$PATH +RUN pip install brilws + +CMD ["/bin/bash"] + diff --git a/README.md b/README.md index 13c56111d3723dfdf90833fba360eac074769e9d..73602cadb18091a87b69190e86980af9a185fe73 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,24 @@ # brilws-docker -CMS BRIL WS in a container. \ No newline at end of file +## Tools from the BRIL work suite in a Docker container + +## To use +Pull the image from Docker Hub and start it up interactively: +``` +docker run --name brilws -it tpmccauley/brilws +``` + +This should bring you to a command line prompt. Then you can test `brilcalc`: + +``` +bril@48c3625738ff:~$ brilcalc --version +3.6.2 +``` + +If you exit you can start up the container again with the command: + +``` +docker start -i brilws +``` + +More information on how to run `brilcalc` and what it does can be found [here](http://opendata.cern.ch/docs/cms-guide-luminosity-calculation) and [here](https://cms-opendata-workshop.github.io/workshop-lesson-luminosity/).