diff --git a/docker/rivet-dev/Dockerfile b/docker/rivet-dev/Dockerfile
--- a/docker/rivet-dev/Dockerfile
+++ b/docker/rivet-dev/Dockerfile
@@ -1,23 +1,26 @@
 FROM fedora:27
 LABEL maintainer="rivet@projects.hepforge.org"
-#RUN dnf update -y
-RUN dnf install -y make gcc-c++ gcc-gfortran redhat-rpm-config wget tar less bzip2 findutils python python-devel file python-matplotlib gsl-devel
-RUN dnf install -y texlive-latex-bin texlive-texconfig-bin texlive-pst-tools which ghostscript ImageMagick texlive-dvips texlive-relsize
-RUN dnf install -y nano zlib-devel
-RUN dnf install -y texlive-cm texlive-hyphen-base
-RUN dnf install -y texlive-collection-fontsrecommended
-RUN dnf clean all
-RUN mkdir /code && cd /code && \
-    wget https://phab.hepforge.org/source/rivetbootstraphg/browse/2.7.0/rivet-bootstrap?view=raw -O rivet-bootstrap && \
-    chmod +x rivet-bootstrap && \
-    INSTALL_PREFIX=/usr/local INSTALL_GSL=0 INSTALL_RIVETDEV=1 MAKE="make -j7" ./rivet-bootstrap
-#RUN rm -rf /code
+
+RUN dnf update -y \
+    && dnf install -y \
+      make gcc-c++ gcc-gfortran redhat-rpm-config \
+      wget tar less bzip2 findutils which nano zlib-devel \
+      python python-devel file python-matplotlib gsl-devel \
+      texlive-latex-bin texlive-texconfig-bin texlive-pst-tools \
+      ghostscript ImageMagick texlive-dvips texlive-relsize \
+      texlive-cm texlive-hyphen-base texlive-collection-fontsrecommended \
+    && dnf clean all
+
+RUN mkdir /code && cd /code \
+    && wget https://phab.hepforge.org/source/rivetbootstraphg/browse/default/rivet-bootstrap?view=raw -O rivet-bootstrap \
+    && chmod +x rivet-bootstrap \
+    && INSTALL_PREFIX=/usr/local INSTALL_GSL=0 INSTALL_RIVETDEV=1 MAKE="make -j7" ./rivet-bootstrap \
+    && echo "source /usr/local/share/Rivet/rivet-completion" > /etc/profile.d/rivet-completion.sh \
+    && echo "source /usr/local/share/YODA/yoda-completion" > /etc/profile.d/yoda-completion.sh \
+    && texconfig rehash \
+    && rm -rf /code/*-*.*.*
+
 ENV LD_LIBRARY_PATH /usr/local/lib
 ENV PYTHONPATH /usr/local/lib64/python2.7/site-packages
-RUN texconfig rehash
-#COPY Rivet.yoda /tmp/Rivet.yoda
-#RUN rivet-mkhtml /tmp/Rivet.yoda
-#RUN ln -s /usr/local/share/Rivet/rivet-completion /etc/bash_completion.d/rivet-completion.sh
-#RUN ln -s /usr/local/share/YODA/yoda-completion /etc/bash_completion.d/yoda-completion.sh
-RUN echo "source /usr/local/share/Rivet/rivet-completion" > /etc/profile.d/rivet-completion.sh
-RUN echo "source /usr/local/share/YODA/yoda-completion" > /etc/profile.d/yoda-completion.sh
+
+WORKDIR /work
diff --git a/docker/rivet-herwig/Dockerfile b/docker/rivet-herwig/Dockerfile
--- a/docker/rivet-herwig/Dockerfile
+++ b/docker/rivet-herwig/Dockerfile
@@ -1,30 +1,34 @@
 FROM hepstore/rivet:2.7.0
 MAINTAINER Andy Buckley <andy.buckley@cern.ch>
 
 RUN dnf install -y boost-devel
 
 RUN mkdir /code
 
+# TODO: combine RUN rules to avoid the large intermediate layers
+
 RUN cd /code && \
     wget https://www.hepforge.org/archive/lhapdf/LHAPDF-6.2.1.tar.gz -O- | tar xz && \
     cd LHAPDF-*/ && ./configure --prefix=/usr/local && \
     make -j5 && make install
 
 #RUN lhapdf install MMHT2014{,n}lo68cl
 RUN cd /usr/local/share/LHAPDF/ && \
     for pdf in MMHT2014{,n}lo68cl; do \
       wget https://lhapdf.hepforge.org/downloads?f=pdfsets/current/$pdf.tar.gz -O- | tar xz; \
     done
 
 RUN cd /code && \
     wget https://www.hepforge.org/archive/thepeg/ThePEG-2.1.4.tar.bz2 -O- | tar xj && \
     cd ThePEG-*/ && ./configure --enable-shared --{prefix,with-{fastjet,hepmc,lhapdf,rivet}}=/usr/local && \
     make -j5 && make install
 
-RUN cd code/ && \
+RUN cd /code && \
     wget https://www.hepforge.org/archive/herwig/Herwig-7.1.4.tar.bz2 -O- | tar xj && \
     cd Herwig-*/ && \
     ./configure --{prefix,with-{thepeg,fastjet}}=/usr/local && \
     make -j5 && make install
 
 RUN rm -rf /code
+
+WORKDIR /work
diff --git a/docker/rivet-pythia/Dockerfile b/docker/rivet-pythia/Dockerfile
--- a/docker/rivet-pythia/Dockerfile
+++ b/docker/rivet-pythia/Dockerfile
@@ -1,23 +1,27 @@
 FROM hepstore/rivet:2.7.0
 MAINTAINER Andy Buckley <andy.buckley@cern.ch>
 
 RUN dnf install -y rsync
 RUN mkdir /code
 
+# TODO: combine RUN rules to avoid the large intermediate layers
+
 RUN cd /code && \
     wget https://www.hepforge.org/archive/lhapdf/LHAPDF-6.2.1.tar.gz -O- | tar xz && \
     cd LHAPDF-*/ && ./configure --prefix=/usr/local && \
     make -j5 && make install
 
 RUN cd /code && \
     wget http://home.thep.lu.se/~torbjorn/pythia8/pythia8240.tgz -O- | tar xz && \
     cd pythia*/ && ./configure --enable-shared --{prefix,with-{hepmc2,lhapdf6}}=/usr/local && \
     make -j5 && make install
 
 RUN cd code/ && \
     wget https://www.hepforge.org/archive/agile/Sacrifice-1.1.1b.tar.gz -O- | tar xz && \
     cd Sacrifice-*/ && \
     ./configure --{prefix,with-{pythia,hepmc,LHAPDF}}=/usr/local && \
     make -j5 && make install
 
 RUN rm -rf /code
+
+WORKDIR /work
diff --git a/docker/rivet/Dockerfile b/docker/rivet/Dockerfile
--- a/docker/rivet/Dockerfile
+++ b/docker/rivet/Dockerfile
@@ -1,23 +1,26 @@
 FROM fedora:27
 LABEL maintainer="rivet@projects.hepforge.org"
-#RUN dnf update -y
-RUN dnf install -y make gcc-c++ gcc-gfortran redhat-rpm-config wget tar less bzip2 findutils python python-devel file python-matplotlib gsl-devel
-RUN dnf install -y texlive-latex-bin texlive-texconfig-bin texlive-pst-tools which ghostscript ImageMagick texlive-dvips texlive-relsize
-RUN dnf install -y nano zlib-devel
-RUN dnf install -y texlive-cm texlive-hyphen-base
-RUN dnf install -y texlive-collection-fontsrecommended
-RUN dnf clean all
-RUN mkdir /code && cd /code && \
-    wget https://phab.hepforge.org/source/rivetbootstraphg/browse/2.7.0/rivet-bootstrap?view=raw -O rivet-bootstrap && \
-    chmod +x rivet-bootstrap && \
-    INSTALL_PREFIX=/usr/local INSTALL_GSL=0 MAKE="make -j7" ./rivet-bootstrap
-RUN rm -rf /code
+
+RUN dnf update -y \
+    && dnf install -y \
+      make gcc-c++ gcc-gfortran redhat-rpm-config \
+      wget tar less bzip2 findutils which nano zlib-devel \
+      python python-devel file python-matplotlib gsl-devel \
+      texlive-latex-bin texlive-texconfig-bin texlive-pst-tools \
+      ghostscript ImageMagick texlive-dvips texlive-relsize \
+      texlive-cm texlive-hyphen-base texlive-collection-fontsrecommended \
+    && dnf clean all
+
+RUN mkdir /code && cd /code \
+    && wget https://phab.hepforge.org/source/rivetbootstraphg/browse/2.7.0/rivet-bootstrap?view=raw -O rivet-bootstrap \
+    && chmod +x rivet-bootstrap \
+    && INSTALL_PREFIX=/usr/local INSTALL_GSL=0 INSTALL_RIVETDEV=0 MAKE="make -j7" ./rivet-bootstrap \
+    && echo "source /usr/local/share/Rivet/rivet-completion" > /etc/profile.d/rivet-completion.sh \
+    && echo "source /usr/local/share/YODA/yoda-completion" > /etc/profile.d/yoda-completion.sh \
+    && texconfig rehash \
+    && rm -rf /code
+
 ENV LD_LIBRARY_PATH /usr/local/lib
 ENV PYTHONPATH /usr/local/lib64/python2.7/site-packages
-RUN texconfig rehash
-#COPY Rivet.yoda /tmp/Rivet.yoda
-#RUN rivet-mkhtml /tmp/Rivet.yoda
-#RUN ln -s /usr/local/share/Rivet/rivet-completion /etc/bash_completion.d/rivet-completion.sh
-#RUN ln -s /usr/local/share/YODA/yoda-completion /etc/bash_completion.d/yoda-completion.sh
-RUN echo "source /usr/local/share/Rivet/rivet-completion" > /etc/profile.d/rivet-completion.sh
-RUN echo "source /usr/local/share/YODA/yoda-completion" > /etc/profile.d/yoda-completion.sh
+
+WORKDIR /work