summaryrefslogtreecommitdiffstats
path: root/03-jmap-proxy/Dockerfile
blob: 25e2b8f100bcc9baa8e82908f193e09a4dc9c0e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
FROM docker.io/library/centos:centos7
MAINTAINER Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>

RUN yum -y install epel-release && \
    yum -y install \
        @fedora-packager \
        gcc \
        git \
        libuuid-devel \
        net-tools \
        nginx \
        perl-AnyEvent-HTTP \
        perl-Archive-Tar \
        perl-CPAN \
        perl-CPAN-Meta \
        perl-CPAN-Meta-Requirements \
        perl-CPAN-Meta-YAML \
        perl-Data-UUID \
        perl-DateTime \
        perl-DBD-SQLite \
        perl-DBI \
        perl-Email-Address \
        perl-Email-MIME \
        perl-ExtUtils-CBuilder \
        perl-ExtUtils-MakeMaker \
        perl-HTML-Parser \
        perl-HTML-Strip \
        perl-HTTP-Tiny \
        perl-Image-Size \
        perl-IO-Socket-SSL \
        perl-JSON \
        perl-JSON-PP \
        perl-JSON-XS \
        perl-Locale-Maketext-Gettext \
        perl-Object-Event \
        perl-Parse-CPAN-Meta \
        perl-Switch \
        screen \
        vim-enhanced

RUN ( sleep 1; \
        echo "yes"; \
    ) | perl -MCPAN -e shell || :

ADD bashrc /root/.bashrc

WORKDIR /srv/
RUN git clone https://github.com/jmapio/jmap-perl.git jmap-perl.git
WORKDIR /srv/jmap-perl.git
RUN echo notest install $(grep -r "^use " bin/ Email/ JMAP/ Mail/ AnyEvent/ | awk '{print $2}' | sed -re 's/;$//g' | sort -u | grep -vE "(base|constant|lib|strict|warnings)") | perl -MCPAN -e shell || :

RUN ( echo "notest install CPAN" ) | perl -MCPAN -e shell
RUN ( echo "notest install List::Pairwise" ) | perl -MCPAN -e shell

WORKDIR /srv/
RUN git clone https://github.com/CindyLinz/Perl-AnyEvent-HTTPD-SendMultiHeaderPatch.git Perl-AnyEvent-HTTPD-SendMultiHeaderPatch.git
WORKDIR /srv/Perl-AnyEvent-HTTPD-SendMultiHeaderPatch.git
RUN perl Makefile.PL && \
    make && \
    make install

WORKDIR /srv/
RUN git clone https://github.com/fastmail/Net-CardDAVTalk.git Net-CardDAVTalk.git
WORKDIR /srv/Net-CardDAVTalk.git
RUN perl Makefile.PL && \
    make && \
    make install

WORKDIR /srv/jmap-perl.git
RUN echo notest install $(grep -r "^use " bin/ Email/ JMAP/ Mail/ AnyEvent/ | awk '{print $2}' | sed -re 's/;$//g' | sort -u | grep -vE "(base|constant|lib|strict|warnings)") | perl -MCPAN -e shell || :

ADD nginx.conf /etc/nginx/nginx.conf

ADD http://cgit.kolab.org/docker/plain/ci/files.d/dbus.service /etc/systemd/system/dbus.service
RUN ln -sf dbus.service /etc/systemd/system/messagebus.service

ADD http://cgit.kolab.org/docker/plain/ci/files.d/httpd.service /etc/systemd/system/httpd.service

ADD http://cgit.kolab.org/docker/plain/ci/files.d/systemctl /usr/bin/systemctl
ADD http://cgit.kolab.org/docker/plain/ci/files.d/systemctl-socket-daemon /usr/bin/systemctl-socket-daemon

RUN chmod -v a+rx \
    /usr/bin/systemctl \
    /usr/bin/systemctl-socket-daemon

WORKDIR /root/
RUN mkdir -p /home/jmap/data/ && ln -s /srv/jmap-perl.git/ /home/jmap/jmap-perl

RUN sed -i -e 's/https:/http:/g' /srv/jmap-perl.git/bin/server.pl

RUN rm -rf \
    /srv/Perl-AnyEvent-HTTPD-SendMultiHeaderPatch.git \
    /srv/Net-CardDAVTalk.git \
    /root/.cpan

EXPOSE 80

ENV jmaphost 172.17.42.1

ADD entrypoint.sh /root/entrypoint.sh
RUN chmod 755 /root/entrypoint.sh
ENTRYPOINT /root/entrypoint.sh