anchor.diff:  VOLUME /usr/portage
   VOLUME /usr/local/portage
   VOLUME /var/tmp/portage
  +VOLUME /var/www/localhost/trac/db
   CMD /usr/local/sbin/run.sh
  
positive.code: # Copyright (c) 2015, Alexandre Hamelin <alexandre.hamelin gmail.com>
  
  FROM gentoo/stage3-amd64
  MAINTAINER Alexandre Hamelin <alexandre.hamelin gmail.com>
  LABEL description="Base system to run Trac in a Gentoo environment" \
        copyright="(c) 2015, Alexandre Hamelin <alexandre.hamelin gmail.com>" \
        license="MIT"
  
  RUN echo 'USE="$USE sqlite"' >> /etc/portage/make.conf
  RUN echo 'MAKEOPTS="-j2"' >> /etc/portage/make.conf
  
  # Install packages and immediately remove the portage tree to avoid increasing
  # the image size too much. The user should mount a volume at this location
  # instead to have the portage tree stored locally on the host OS.
  RUN emerge-webrsync -q && \
      emerge -q app-portage/eix app-portage/gentoolkit app-editors/vim \
                net-misc/curl www-servers/apache www-apache/mod_wsgi \
                www-apps/trac && \
      eselect news read --quiet && \
      rm -fr /usr/portage
  
  
negative.code:     trac-admin /var/www/localhost/trac milestone remove milestone2 && \
      trac-admin /var/www/localhost/trac milestone remove milestone3 && \
      trac-admin /var/www/localhost/trac milestone remove milestone4
  RUN trac-admin /var/www/localhost/trac permission add anonymous TRAC_ADMIN
  RUN mkdir /var/www/localhost/trac/{files,cgi-bin}
  RUN chgrp -R apache /var/www/localhost/trac/{db,log,files,conf,plugins}
  RUN chmod g+rwx /var/www/localhost/trac/{db,log,files,conf,plugins}
  