netsandbox / docker-rt

Docker image with RT installation
GNU General Public License v2.0
28 stars 24 forks source link

RT 5.0 #6

Closed vnznznz closed 4 years ago

vnznznz commented 4 years ago

RT 5.0 will release "soon" would be great to have a docker image for our integration tests :)

If I have time this weekend I'll try to build a PR.

netsandbox commented 4 years ago

I have this also on my ToDo list, maybe I find time this weekend to do this..

vnznznz commented 4 years ago

Ok sounds great! Here is my Dockerfile (based on your work). It boots but needs some cleanup.

FROM debian:sid-slim

ENV RT_VERSION 5.0.0beta2
ENV RT_SHA 58687fd1103c04a4f0b622e54d1d4097f36d45aa4d744374add2f76591ceb0ff

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
    apache2 \
    cpanminus \
    curl \
    gcc \
    gnupg \
    vim \
    # RT core dependencies
    libapache2-mod-fcgid \
    libapache-session-perl \
    libbusiness-hours-perl \
    libc-dev \
    libcgi-emulate-psgi-perl \
    libcgi-psgi-perl \
    libconvert-color-perl \
    libcrypt-eksblowfish-perl \
    libcrypt-ssleay-perl \
    libcss-minifier-xs-perl \
    libcss-squish-perl \
    libdata-guid-perl \
    libdata-ical-perl \
    libdata-page-pageset-perl \
    libdata-page-perl \
    libdate-extract-perl \
    libdate-manip-perl \
    libdatetime-format-natural-perl \
    libdbd-sqlite3-perl \
    libdbix-searchbuilder-perl \
    libdevel-globaldestruction-perl \
    libemail-address-list-perl \
    libemail-address-perl \
    libencode-perl \
    libfcgi-perl \
    libfcgi-procmanager-perl \
    libfile-sharedir-install-perl \
    libfile-sharedir-perl \
    libgd-graph-perl \
    libgraphviz-perl \
    libhtml-formattext-withlinks-andtables-perl \
    libhtml-formattext-withlinks-perl \
    libhtml-mason-perl  \
    libhtml-mason-psgihandler-perl \
    libhtml-quoted-perl \
    libhtml-rewriteattributes-perl \
    libhtml-scrubber-perl  \
    libipc-run3-perl \
    libipc-signal-perl \
    libjavascript-minifier-xs-perl \
    libjson-perl \
    liblocale-maketext-fuzzy-perl \
    liblocale-maketext-lexicon-perl \
    liblog-dispatch-perl \
    libmailtools-perl \
    libmime-tools-perl \
    libmime-types-perl \
    libmodule-refresh-perl \
    libmodule-signature-perl \
    libmodule-versions-report-perl \
    libnet-cidr-perl \
    libnet-ip-perl \
    libplack-perl \
    libregexp-common-net-cidr-perl \
    libregexp-common-perl \
    libregexp-ipv6-perl \
    librole-basic-perl \
    libscope-upper-perl \
    libserver-starter-perl \
    libsymbol-global-name-perl \
    libterm-readkey-perl  \
    libtext-password-pronounceable-perl \
    libtext-quoted-perl \
    libtext-template-perl \
    libtext-wikiformat-perl  \
    libtext-wrapper-perl \
    libtimedate-perl \
    libtree-simple-perl  \
    libuniversal-require-perl \
    libxml-rss-perl \
    make \
    perl-doc \
    starlet \
    w3m \
    # RT developer dependencies
    libemail-abstract-perl \
    libfile-which-perl \
    liblocale-po-perl \
    liblog-dispatch-perl-perl \
    libmojolicious-perl \
    libperlio-eol-perl \
    libplack-middleware-test-stashwarnings-perl \
    libset-tiny-perl \
    libstring-shellquote-perl \
    libtest-deep-perl \
    libtest-email-perl \
    libtest-expect-perl \
    libtest-longstring-perl \
    libtest-mocktime-perl \
    libtest-nowarnings-perl \
    libtest-pod-perl \
    libtest-warn-perl \
    libtest-www-mechanize-perl \
    libtest-www-mechanize-psgi-perl \
    libwww-mechanize-perl \
    libxml-simple-perl \
&& rm -rf /var/lib/apt/lists/*

RUN cpanm \
  # RT dependencies
  Module::Install \
  Email::Address \
  Email::Address::List \
  Mozilla::CA \
  # RT extension development dependencies
  ExtUtils::MakeMaker \
  Module::Install::RTx \
  Module::Install::Substitute \
&& rm -rf /root/.cpanm

# logs should go to stdout / stderr
ENV APACHE_CONFDIR /etc/apache2
RUN set -eux; \
  . $APACHE_CONFDIR/envvars; \
  ln -sfT /dev/stderr "$APACHE_LOG_DIR/error.log"; \
  ln -sfT /dev/stdout "$APACHE_LOG_DIR/access.log"; \
  ln -sfT /dev/stdout "$APACHE_LOG_DIR/other_vhosts_access.log"; \
  chown -R --no-dereference "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$APACHE_LOG_DIR"

RUN cpanm \
  # RT dependencies
  Module::Path \
  Moose \
  MooseX::NonMoose \
  MooseX::Role::Parameterized \
  Path::Dispatcher \
  Web::Machine

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
  libgumbo-dev \
  libencode-detect-perl

RUN cpanm \
  # RT dependencies
  Encode::Detect::Detector \
  Encode::HanExtra \
  HTML::FormatExternal \
  HTML::Gumbo

RUN cpanm \
  Time::ParseDate

RUN cd /usr/local/src \
  && curl -sSL "https://download.bestpractical.com/pub/rt/devel/rt-${RT_VERSION}.tar.gz" -o rt.tar.gz \
  && echo "${RT_SHA}  rt.tar.gz" | sha256sum -c \
  && tar -xzf rt.tar.gz

RUN cd "/usr/local/src/rt-${RT_VERSION}" \
  && ./configure \
    --disable-gpg --disable-smime --enable-developer --enable-gd --enable-graphviz --with-db-type=SQLite \
  && make install \
  && make initdb \
  && rm -rf /usr/local/src/*

COPY apache.rt.conf /etc/apache2/sites-available/rt.conf
RUN a2dissite 000-default.conf && a2ensite rt.conf

RUN chown -R www-data:www-data /opt/rt5/var/

COPY RT_SiteConfig.pm /opt/rt5/etc/RT_SiteConfig.pm

VOLUME /opt/rt5

COPY docker-entrypoint.sh /usr/local/bin/

ENTRYPOINT ["docker-entrypoint.sh"]

COPY apache2-foreground /usr/local/bin/

EXPOSE 80
CMD ["apache2-foreground"]
netsandbox commented 4 years ago

RT 5.0 docker image is available:

docker pull netsandbox/request-tracker:5.0