FROM ubuntu:16.04 MAINTAINER Michael Crute ARG bz_version ADD binaries/ /tmp/ ADD patches/ /tmp/ RUN export DEBIAN_FRONTEND=noninteractive && \ echo 'Acquire::http::Proxy "http://genesis.sea1.crute.me:3142";' > /etc/apt/apt.conf && \ apt-get update && \ # Perl needs the UTF-8 locale apt-get install -y locales && \ locale-gen en_US.UTF-8 && \ # Install system dependencies apt-get install -y \ cron \ nginx \ patch \ python-boto3 \ runit \ sudo \ syslog-ng \ && \ # Install Bugzilla dependencies apt-get install -y \ graphviz \ libappconfig-perl \ libauthen-radius-perl \ libauthen-sasl-perl \ libcache-memcached-fast-perl \ libcgi-pm-perl \ libchart-perl \ libdaemon-generic-perl \ libdate-calc-perl \ libdatetime-perl \ libdatetime-timezone-perl \ libdbd-mysql-perl \ libdbd-sqlite3-perl \ libdbi-perl \ libemail-mime-perl \ libemail-reply-perl \ libemail-sender-perl \ libencode-detect-perl \ libfile-copy-recursive-perl \ libfile-mimeinfo-perl \ libfile-slurp-perl \ libfile-which-perl \ libgd-graph-perl \ libhtml-formattext-withlinks-perl \ libhtml-scrubber-perl \ libjson-rpc-perl \ libmath-random-isaac-perl \ libmath-random-isaac-xs-perl \ libmime-tools-perl \ libmodule-build-perl \ libmoox-strictconstructor-perl \ libnet-ldap-perl \ libplack-perl \ libsoap-lite-perl \ libtemplate-perl \ libtemplate-plugin-gd-perl \ libtest-taint-perl \ libtext-multimarkdown-perl \ libtheschwartz-perl \ liburi-db-perl \ libxml-perl \ libxml-twig-perl \ perlmagick \ python-sphinx \ rst2pdf \ && \ dpkg -i /tmp/libpatchreader-perl_0.9.6-1_all.deb && \ dpkg -i /tmp/libtheschwartz-perl_1.12-1_all.deb && \ # Setup users and groups groupadd -g 901 bugzilla && \ usermod -a -G bugzilla www-data && \ useradd -d /var/www/html/bugzilla -M -N -g bugzilla -G www-data -s /bin/bash -u 901 bugzilla && \ # Setup bugzilla app curl -L -o "/tmp/release-${bz_version}.tar.gz" "https://github.com/bugzilla/bugzilla/archive/release-${bz_version}.tar.gz" && \ mkdir -p /var/www/html && \ tar -C /var/www/html/ -xvzf /tmp/release-${bz_version}.tar.gz && \ ln -s /var/www/html/bugzilla-release-${bz_version} /var/www/html/bugzilla && \ tar -C /var/www/html/bugzilla/skins/contrib/ -xvzf /tmp/Bright-Skin.tar.gz && \ rm /etc/nginx/sites-enabled/default && \ ln -s /etc/nginx/sites-available/bugzilla /etc/nginx/sites-enabled/bugzilla && \ # Run the initial setup # # The bugzilla user must have permissions to modify files in the release # directory because checksetup.pl will change permissions so that the files are # owned by that user. Without those permission changes running plack will fail # with permission errors. Additionally, all checksetup.pl invocations must # happen as the bugzilla user for permissions to be properly updated. chown -R bugzilla /var/www/html/bugzilla-release-${bz_version} && \ # First time creates the config file cd /var/www/html/bugzilla && sudo -u bugzilla ./checksetup.pl /tmp/answers.pl && \ # Second time does the real setup cd /var/www/html/bugzilla && sudo -u bugzilla ./checksetup.pl /tmp/answers.pl && \ # Allow admin overrides mkdir /srv/bugzilla && \ mv /var/www/html/bugzilla/localconfig /srv/bugzilla/localconfig && \ ln -s /srv/bugzilla/localconfig /var/www/html/bugzilla/localconfig && \ mv /var/www/html/bugzilla/data/db /srv/bugzilla/ && \ ln -s /srv/bugzilla/db /var/www/html/bugzilla/data/ && \ mv /var/www/html/bugzilla/data/attachments /srv/bugzilla/ && \ ln -s /srv/bugzilla/attachments /var/www/html/bugzilla/data/ && \ mv /var/www/html/bugzilla/data/mining /srv/bugzilla/ && \ ln -s /srv/bugzilla/mining /var/www/html/bugzilla/data/ && \ cp /var/www/html/bugzilla/data/params.json /srv/bugzilla/ && \ # Enable voting extension rm /var/www/html/bugzilla/extensions/Voting/disabled && \ # Patch the code # Update the email_in script to lookup by email instead of assuming that # usernames are the same as email addresses. cd / && patch -p1 < /tmp/email_in.pl.patch && \ # Clean up rm /etc/apt/apt.conf && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* && \ rm -rf /tmp/* ADD usr/ /usr/ ADD etc/ /etc/ STOPSIGNAL SIGHUP CMD [ "/usr/bin/dumb-init", "/usr/bin/runsvdir", "/etc/service" ]