summaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
Diffstat (limited to 'docker')
-rw-r--r--docker/biboumi-test/alpine/Dockerfile53
-rw-r--r--docker/biboumi-test/archlinux/Dockerfile13
-rw-r--r--docker/biboumi-test/debian/Dockerfile92
-rw-r--r--docker/biboumi-test/fedora/Dockerfile91
-rw-r--r--docker/biboumi/Dockerfile41
-rw-r--r--docker/biboumi/README.md68
-rw-r--r--docker/biboumi/biboumi.cfg6
-rw-r--r--docker/packaging/debian/Dockerfile10
8 files changed, 272 insertions, 102 deletions
diff --git a/docker/biboumi-test/alpine/Dockerfile b/docker/biboumi-test/alpine/Dockerfile
new file mode 100644
index 0000000..f97c58c
--- /dev/null
+++ b/docker/biboumi-test/alpine/Dockerfile
@@ -0,0 +1,53 @@
+# This Dockerfile creates a docker image suitable to run biboumi’s build and
+# tests. For example, it can be used on with gitlab-ci.
+
+FROM docker.io/alpine:latest
+
+ENV LC_ALL C.UTF-8
+
+# Needed to build biboumi
+RUN apk add --no-cache g++\
+ clang\
+ valgrind\
+ udns-dev\
+ sqlite-dev\
+ libuuid\
+ util-linux-dev\
+ libgcrypt-dev\
+ cmake\
+ make\
+ expat-dev\
+ libidn-dev\
+ git\
+ py3-lxml\
+ libtool\
+ py3-pip\
+ python2\
+ python3-dev\
+ automake\
+ autoconf\
+ flex\
+ bison\
+ libltdl\
+ openssl\
+ libressl-dev\
+ zlib-dev\
+ curl
+
+# Install botan
+RUN git clone https://github.com/randombit/botan.git && cd botan && ./configure.py --prefix=/usr && make -j8 && make install && rm -rf /botan
+
+# Install slixmpp, for e2e tests
+RUN git clone https://github.com/saghul/aiodns.git && cd aiodns && git checkout 7ee13f9bea25784322~ && python3 setup.py build && python3 setup.py install && git clone git://git.louiz.org/slixmpp && pip3 install pyasn1 && cd slixmpp && python3 setup.py build && python3 setup.py install
+
+RUN adduser tester -D -h /home/tester
+
+# Install charybdis, for e2e tests
+RUN git clone https://github.com/charybdis-ircd/charybdis.git && cd charybdis && cd /charybdis && git checkout 4f2b9a4 && sed s/113/1113/ -i /charybdis/authd/providers/ident.c && ./autogen.sh && ./configure --prefix=/home/tester/ircd --bindir=/usr/bin && make -j8 && make install && rm -rf /charybdis
+
+RUN chown -R tester:tester /home/tester/ircd
+
+RUN yes "" | openssl req -nodes -x509 -newkey rsa:4096 -keyout /home/tester/ircd/etc/ssl.key -out /home/tester/ircd/etc/ssl.pem
+
+WORKDIR /home/tester
+USER tester
diff --git a/docker/biboumi-test/archlinux/Dockerfile b/docker/biboumi-test/archlinux/Dockerfile
new file mode 100644
index 0000000..20f0343
--- /dev/null
+++ b/docker/biboumi-test/archlinux/Dockerfile
@@ -0,0 +1,13 @@
+FROM docker.io/base/archlinux:latest
+
+RUN pacman -Syuuuu --noconfirm
+
+RUN pacman -Syu --noconfirm cmake base-devel git clang-tools-extra
+
+RUN useradd -m -G wheel -s /bin/bash builder
+
+RUN sed -i '/^# %wheel ALL=(ALL) NOPASSWD: ALL/s/^# //' /etc/sudoers
+
+WORKDIR /home/builder
+
+USER builder
diff --git a/docker/biboumi-test/debian/Dockerfile b/docker/biboumi-test/debian/Dockerfile
index 9aac3ec..232a585 100644
--- a/docker/biboumi-test/debian/Dockerfile
+++ b/docker/biboumi-test/debian/Dockerfile
@@ -3,72 +3,58 @@
FROM docker.io/debian:latest
+ENV LC_ALL C.UTF-8
+
RUN apt update
# Needed to build biboumi
-RUN apt install -y g++
-RUN apt install -y clang
-RUN apt install -y valgrind
-RUN apt install -y libc-ares-dev
-RUN apt install -y libsqlite3-dev
-RUN apt install -y libuuid1
-RUN apt install -y cmake
-RUN apt install -y make
-RUN apt install -y libexpat1-dev
-RUN apt install -y libidn11-dev
-RUN apt install -y uuid-dev
-RUN apt install -y libsystemd-dev
-RUN apt install -y pandoc
-
-# Needed to run tests
-RUN apt install -y git
-RUN apt install -y python3-lxml
-RUN apt install -y lcov
+RUN apt install -y g++\
+ clang\
+ valgrind\
+ libudns-dev\
+ libc-ares-dev\
+ libsqlite3-dev\
+ libuuid1\
+ libgcrypt20-dev\
+ cmake\
+ make\
+ libexpat1-dev\
+ libidn11-dev\
+ uuid-dev\
+ libsystemd-dev\
+ pandoc\
+ libasan1\
+ libubsan0\
+ git\
+ python3-lxml\
+ lcov\
+ libtool\
+ python3-pip\
+ python3-dev\
+ automake\
+ autoconf\
+ flex\
+ bison\
+ libltdl-dev\
+ openssl\
+ zlib1g-dev\
+ libssl-dev\
+ curl
# Install botan
-RUN git clone https://github.com/randombit/botan.git
-RUN cd botan && ./configure.py --prefix=/usr && make -j8 && make install
-RUN rm -rf /botan
-
-# Install litesql
-RUN git clone git://git.louiz.org/litesql
-RUN mkdir /litesql/build && cd /litesql/build && cmake .. -DCMAKE_INSTALL_PREFIX=/usr && make -j8
-RUN cd /litesql/build && make install
-RUN rm -rf /litesql
-
-RUN ldconfig
+RUN git clone https://github.com/randombit/botan.git && cd botan && ./configure.py --prefix=/usr && make -j8 && make install && rm -rf /botan
# Install slixmpp, for e2e tests
-RUN git clone https://github.com/saghul/aiodns.git
-RUN cd aiodns && python3 setup.py build && python3 setup.py install
-RUN apt install -y python3-pip
-RUN git clone git://git.louiz.org/slixmpp
-RUN pip3 install pyasn1
-RUN apt install -y python3-dev
-RUN cd slixmpp && python3 setup.py build && python3 setup.py install
+RUN git clone https://github.com/saghul/aiodns.git && cd aiodns && git checkout 7ee13f9bea25784322~ && python3 setup.py build && python3 setup.py install && git clone git://git.louiz.org/slixmpp && pip3 install pyasn1 && cd slixmpp && python3 setup.py build && python3 setup.py install
RUN useradd tester -m
# Install charybdis, for e2e tests
-RUN apt install -y automake autoconf flex bison libltdl-dev openssl zlib1g-dev
-RUN apt install -y libtool
-RUN git clone https://github.com/charybdis-ircd/charybdis.git && cd charybdis
-RUN cd /charybdis && git checkout 4f2b9a4 && ./autogen.sh && ./configure --prefix=/home/tester/ircd --bindir=/usr/bin && make -j8 && make install
-RUN chown -R tester:tester /home/tester/ircd
-RUN rm -rf /charybdis
-
-RUN apt install -y locales
-RUN export LANGUAGE=en_US.UTF-8
-RUN export LANG=en_US.UTF-8
-RUN export LC_ALL=en_US.UTF-8
-RUN locale-gen
-RUN dpkg-reconfigure locales
+RUN git clone https://github.com/charybdis-ircd/charybdis.git && cd charybdis && cd /charybdis && git checkout 4f2b9a4 && sed s/113/1113/ -i /charybdis/authd/providers/ident.c && ./autogen.sh && ./configure --prefix=/home/tester/ircd --bindir=/usr/bin && make -j8 && make install && rm -rf /charybdis
-RUN dpkg-reconfigure locales && \
- locale-gen C.UTF-8 && \
- /usr/sbin/update-locale LANG=C.UTF-8
+RUN chown -R tester:tester /home/tester/ircd
-ENV LC_ALL C.UTF-8
+RUN yes "" | openssl req -nodes -x509 -newkey rsa:4096 -keyout /home/tester/ircd/etc/ssl.key -out /home/tester/ircd/etc/ssl.pem
WORKDIR /home/tester
USER tester
diff --git a/docker/biboumi-test/fedora/Dockerfile b/docker/biboumi-test/fedora/Dockerfile
index ebcb4e4..384fd51 100644
--- a/docker/biboumi-test/fedora/Dockerfile
+++ b/docker/biboumi-test/fedora/Dockerfile
@@ -3,67 +3,60 @@
FROM docker.io/fedora:latest
-RUN dnf update -y
-
-# Needed to build biboumi
-RUN dnf install -y gcc-c++
-RUN dnf install -y clang
-RUN dnf install -y valgrind
-RUN dnf install -y c-ares-devel
-RUN dnf install -y sqlite-devel
-RUN dnf install -y libuuid-devel
-RUN dnf install -y cmake
-RUN dnf install -y make
-RUN dnf install -y expat-devel
-RUN dnf install -y libidn-devel
-RUN dnf install -y uuid-devel
-RUN dnf install -y systemd-devel
-RUN dnf install -y pandoc
-
-# Needed to run tests
-RUN dnf install -y git
-RUN dnf install -y fedora-packager python3-lxml
-RUN dnf install -y lcov
-
-# To be able to create the RPM
-RUN dnf install -y rpmdevtools
+ENV LC_ALL C.UTF-8
+
+RUN dnf --refresh install -y\
+ gcc-c++\
+ clang\
+ valgrind\
+ udns-devel\
+ c-ares-devel\
+ sqlite-devel\
+ libuuid-devel\
+ libgcrypt-devel\
+ cmake\
+ make\
+ expat-devel\
+ libidn-devel\
+ uuid-devel\
+ systemd-devel\
+ pandoc\
+ libasan\
+ libubsan\
+ git\
+ fedora-packager\
+ python3-lxml\
+ lcov\
+ rpmdevtools\
+ python3-devel\
+ automake\
+ autoconf\
+ flex\
+ flex-devel\
+ bison\
+ libtool-ltdl-devel\
+ libtool\
+ openssl-devel\
+ which\
+ java-1.8.0-openjdk\
+ && dnf clean all
# Install botan
-RUN git clone https://github.com/randombit/botan.git
-RUN cd botan && ./configure.py --prefix=/usr && make -j8 && make install
-RUN rm -rf /botan
-
-# Install litesql
-RUN git clone git://git.louiz.org/litesql
-RUN mkdir /litesql/build && cd /litesql/build && cmake .. -DCMAKE_INSTALL_PREFIX=/usr && make -j8
-RUN cd /litesql/build && make install
-RUN rm -rf /litesql
-
-RUN ldconfig
+RUN git clone https://github.com/randombit/botan.git && cd botan && ./configure.py --prefix=/usr && make -j8 && make install && ldconfig && rm -rf /botan
# Install slixmpp, for e2e tests
-RUN git clone git://git.louiz.org/slixmpp
-RUN pip3 install pyasn1
-RUN dnf install -y python3-devel
-RUN cd slixmpp && python3 setup.py build && python3 setup.py install
+RUN git clone git://git.louiz.org/slixmpp && pip3 install pyasn1 && cd slixmpp && python3 setup.py build && python3 setup.py install
RUN useradd tester
# Install charybdis, for e2e tests
-RUN dnf install -y automake autoconf flex flex-devel bison libtool-ltdl-devel openssl-devel
-RUN dnf install -y libtool
-RUN git clone https://github.com/charybdis-ircd/charybdis.git && cd charybdis
-RUN cd /charybdis && git checkout 4f2b9a4 && ./autogen.sh && ./configure --prefix=/home/tester/ircd --bindir=/usr/bin --with-included-boost && make -j8 && make install
+RUN git clone https://github.com/charybdis-ircd/charybdis.git && cd charybdis && cd /charybdis && git checkout 4f2b9a4 && sed s/113/1113/ -i /charybdis/authd/providers/ident.c && ./autogen.sh && ./configure --prefix=/home/tester/ircd --bindir=/usr/bin --with-included-boost && make -j8 && make install && rm -rf /charybdis
+
RUN chown -R tester:tester /home/tester/ircd
-RUN rm -rf /charybdis
-RUN su - tester -c "echo export LANG=en_GB.utf-8 >> /home/tester/.bashrc"
+RUN yes "" | openssl req -nodes -x509 -newkey rsa:4096 -keyout /home/tester/ircd/etc/ssl.key -out /home/tester/ircd/etc/ssl.pem
COPY coverity /home/tester/coverity
-COPY sonar-scanner-2.8 /home/tester/sonar-scanner
-
-RUN dnf install -y which java-1.8.0-openjdk
WORKDIR /home/tester
USER tester
-
diff --git a/docker/biboumi/Dockerfile b/docker/biboumi/Dockerfile
new file mode 100644
index 0000000..67f0f41
--- /dev/null
+++ b/docker/biboumi/Dockerfile
@@ -0,0 +1,41 @@
+# This Dockerfile creates a docker image running biboumi
+
+FROM docker.io/alpine:latest
+
+RUN apk add --no-cache\
+ g++\
+ cmake\
+ make\
+ udns-dev\
+ sqlite-dev\
+ libuuid\
+ util-linux-dev\
+ expat-dev\
+ libidn-dev\
+ git\
+ python2
+
+# Install botan
+RUN git clone https://github.com/randombit/botan.git && cd botan && ./configure.py --prefix=/usr && make -j8 && make install && rm -rf /botan
+
+# Install biboumi
+RUN git clone git://git.louiz.org/biboumi && mkdir ./biboumi/build && cd ./biboumi/build &&\
+ cmake .. -DCMAKE_INSTALL_PREFIX=/usr\
+ -DCMAKE_BUILD_TYPE=Release\
+ -DWITH_BOTAN=1\
+ -DWITH_SQLITE3=1\
+ -DWITH_LIBIDN=1\
+ && make -j8 && make install && rm -rf /biboumi
+
+RUN adduser biboumi -D -h /home/biboumi
+
+RUN mkdir /var/lib/biboumi
+RUN chown -R biboumi:biboumi /var/lib/biboumi
+
+COPY ./biboumi.cfg /etc/biboumi/biboumi.cfg
+RUN chown -R biboumi:biboumi /etc/biboumi
+
+WORKDIR /home/biboumi
+USER biboumi
+
+CMD ["/usr/bin/biboumi", "/etc/biboumi/biboumi.cfg"]
diff --git a/docker/biboumi/README.md b/docker/biboumi/README.md
new file mode 100644
index 0000000..4b9e1e5
--- /dev/null
+++ b/docker/biboumi/README.md
@@ -0,0 +1,68 @@
+Biboumi Docker Image
+====================
+
+Running
+-------
+
+This image does not embed any XMPP server. You need to have a running XMPP server first: as an other docker image, or running on the host machine.
+
+Assuming you have a running [prosody](https://hub.docker.com/r/prosody/prosody/) container already running and [properly configured](https://prosody.im/doc/components#adding_an_external_component) you can use the following command to start your biboumi container.
+
+```
+docker run --link prosody:xmpp \
+ -v $PWD/database:/var/lib/biboumi \
+ -e BIBOUMI_PASSWORD=P4SSW0RD \
+ -e BIBOUMI_HOSTNAME=irc.example.com \
+ -e BIBOUMI_ADMIN=blabla \
+ biboumi
+```
+
+If instead you already have an XMPP server running on the host machine, you can start the biboumi container like this:
+
+```
+docker run --network=host \
+ -v $PWD/database:/var/lib/biboumi \
+ -e BIBOUMI_PASSWORD=P4SSW0RD \
+ -e BIBOUMI_HOSTNAME=irc.example.com \
+ -e BIBOUMI_ADMIN=blabla \
+ -e BIBOUMI_XMPP_SERVER_IP=127.0.0.1 \
+ biboumi
+```
+
+Variables
+---------
+
+The configuration file inside the image contains only a few default values. To be able to run, biboumi needs additional configuration. Additional options can be passed using environment variables. Any configuration option can be customized this way (see biboumi’s doc), but the main are listed here for convenience:
+
+* BIBOUMI_HOSTNAME: Sets the value of the *hostname* option.
+* BIBOUMI_PASSWORD: Sets the value of the *password* option.
+* BIBOUMI_ADMIN: Sets the value of the *admin* option.
+* BIBOUMI_XMPP_SERVER_IP: Sets the value of the *xmpp_server_ip* option. The default value is **xmpp**.
+
+You can also directly provide your own configuration file by mounting it inside the container using the -v option:
+
+```
+docker run --link prosody:xmpp \
+ -v $PWD/biboumi.cfg:/etc/biboumi/biboumi.cfg \
+ biboumi
+```
+
+If both a custom configuration file and custom environment variables are passed to the container, the environment variables will take precedence.
+
+Linking with the XMPP server
+----------------------------
+
+You can use the --link option to connect to any server running in a docker container, but it needs to be called *xmpp*, or the custom value set for the **BIBOUMI_XMPP_SERVER_IP** option. For example, if you are using a container named ejabberd, you would use the option *--link ejabberd:xmpp*.
+
+If you want to connect to the XMPP server running on the host machine, use the **--network=host** option.
+
+Volumes
+-------
+
+The database is stored in the /var/lib/biboumi/ directory. If you don’t bind a local directory to it, the database will be lost when the container is stopped. If you want to keep your database between each run, bind it with the -v option, like this: **-v /srv/biboumi/:/var/lib/biboumi**.
+
+Note: Due to a limitation in Docker, to be able to read and write into this database, make sure this mounted directory is owned by UID and GID 1001:1001, on the host.
+
+```
+chown -R 1001:1001 database/
+```
diff --git a/docker/biboumi/biboumi.cfg b/docker/biboumi/biboumi.cfg
new file mode 100644
index 0000000..98c5a9f
--- /dev/null
+++ b/docker/biboumi/biboumi.cfg
@@ -0,0 +1,6 @@
+xmpp_server_ip=127.0.0.1
+port=5347
+db_name=/var/lib/biboumi/biboumi.sqlite
+hostname=xmpp
+password=
+admin=
diff --git a/docker/packaging/debian/Dockerfile b/docker/packaging/debian/Dockerfile
new file mode 100644
index 0000000..f9f4d84
--- /dev/null
+++ b/docker/packaging/debian/Dockerfile
@@ -0,0 +1,10 @@
+# This Dockerfile creates a docker image suitable to build a debian package
+
+FROM docker.io/debian:sid
+
+RUN apt update
+
+# Needed to build biboumi
+RUN apt install -y \
+ git \
+ devscripts