From 49c86398a557856fb202c449790d0b4afffb1182 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Sat, 19 Aug 2017 13:18:32 +0200 Subject: Change docker documentation regarding the database permissions fix #3290 --- docker/biboumi/alpine/README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'docker') diff --git a/docker/biboumi/alpine/README.md b/docker/biboumi/alpine/README.md index 4b9e1e5..806bdc5 100644 --- a/docker/biboumi/alpine/README.md +++ b/docker/biboumi/alpine/README.md @@ -61,8 +61,9 @@ 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. +Note: Due to a limitation in Docker, to be able to read and write into this database, make sure this mounted directory has the proper read and write permissions on the host: it can be owned by UID and GID 1000:1000, or use chmod to give permissions to everyone, for example. ``` -chown -R 1001:1001 database/ +chown -R 1000:1000 database/ +chmod 777 database/ ``` -- cgit v1.2.3 From b1f850b6395610c738a8e58abcdf2abfca3edd4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Sat, 16 Dec 2017 16:18:59 +0100 Subject: Update the docker images to enable postgresql, and document them --- docker/biboumi-test/alpine/Dockerfile | 3 ++- docker/biboumi-test/debian/Dockerfile | 3 ++- docker/biboumi-test/fedora/Dockerfile | 1 + docker/biboumi/alpine/Dockerfile | 2 ++ docker/biboumi/alpine/README.md | 25 ++++++++++++++++++++++++- 5 files changed, 31 insertions(+), 3 deletions(-) (limited to 'docker') diff --git a/docker/biboumi-test/alpine/Dockerfile b/docker/biboumi-test/alpine/Dockerfile index f97c58c..e43f1b6 100644 --- a/docker/biboumi-test/alpine/Dockerfile +++ b/docker/biboumi-test/alpine/Dockerfile @@ -32,7 +32,8 @@ RUN apk add --no-cache g++\ openssl\ libressl-dev\ zlib-dev\ - curl + curl\ + postgresql-dev # Install botan RUN git clone https://github.com/randombit/botan.git && cd botan && ./configure.py --prefix=/usr && make -j8 && make install && rm -rf /botan diff --git a/docker/biboumi-test/debian/Dockerfile b/docker/biboumi-test/debian/Dockerfile index 3a1c1a7..65c964e 100644 --- a/docker/biboumi-test/debian/Dockerfile +++ b/docker/biboumi-test/debian/Dockerfile @@ -39,7 +39,8 @@ RUN apt install -y g++\ openssl\ zlib1g-dev\ libssl-dev\ - curl + curl\ + libpq-dev # Install botan RUN git clone https://github.com/randombit/botan.git && cd botan && ./configure.py --prefix=/usr && make -j8 && make install && rm -rf /botan diff --git a/docker/biboumi-test/fedora/Dockerfile b/docker/biboumi-test/fedora/Dockerfile index 8ff418c..12e13e5 100644 --- a/docker/biboumi-test/fedora/Dockerfile +++ b/docker/biboumi-test/fedora/Dockerfile @@ -39,6 +39,7 @@ RUN dnf --refresh install -y\ openssl-devel\ which\ java-1.8.0-openjdk\ + postgresql-devel\ && dnf clean all # Install botan diff --git a/docker/biboumi/alpine/Dockerfile b/docker/biboumi/alpine/Dockerfile index c1bf5fd..0b59eb7 100644 --- a/docker/biboumi/alpine/Dockerfile +++ b/docker/biboumi/alpine/Dockerfile @@ -13,6 +13,7 @@ RUN apk add --no-cache\ make\ udns-dev\ sqlite-dev\ + postgresql-dev\ libuuid\ util-linux-dev\ expat-dev\ @@ -30,6 +31,7 @@ RUN git clone git://git.louiz.org/biboumi && mkdir ./biboumi/build && cd ./bibou -DWITH_BOTAN=1\ -DWITH_SQLITE3=1\ -DWITH_LIBIDN=1\ + -DWITH_POSTGRESQL=1\ && make -j8 && make install && rm -rf /biboumi RUN adduser biboumi -D -h /home/biboumi diff --git a/docker/biboumi/alpine/README.md b/docker/biboumi/alpine/README.md index 806bdc5..6385e94 100644 --- a/docker/biboumi/alpine/README.md +++ b/docker/biboumi/alpine/README.md @@ -38,6 +38,7 @@ The configuration file inside the image contains only a few default values. To * 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**. +* BIBOUMI_DB_NAME: Sets the database name to be used by biboumi: a filesystem path pointing at a Sqlite3 file, or a postgresql URI (starting with “postgresql://”). See below to learn how to mount a host directory (to save your Sqlite3 database) or how to link with a postgresql docker container. You can also directly provide your own configuration file by mounting it inside the container using the -v option: @@ -59,7 +60,7 @@ If you want to connect to the XMPP server running on the host machine, use the * 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**. +By default, a sqlite3 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 has the proper read and write permissions on the host: it can be owned by UID and GID 1000:1000, or use chmod to give permissions to everyone, for example. @@ -67,3 +68,25 @@ Note: Due to a limitation in Docker, to be able to read and write into this data chown -R 1000:1000 database/ chmod 777 database/ ``` + +Linking with a PostgreSQL container +----------------------------------- + +If you want to use a PostgreSQL database, you need to either access the host database (run the biboumi container with --network=host), or link with a [postgresql docker image](https://hub.docker.com/_/postgres/). + +To do that, start the PostgreSQL container like this: + +``` +docker run --name postgres postgres:latest +``` + +This will run a postgresql instance with a configured superuser named “postgres”, with no password and a database named “postgres” as well. If you want different values, please refer to the PostgreSQL’s image documentation. + +Then start your biboumi container, by linking with this PostgreSQL container, and by specifying the correct db_name value (of course, also specify all the other options, like the XMPP hostname and password): + +``` +docker run --name biboumi \ + --link=postgres \ + -e BIBOUMI_DB_NAME=postgres://postgres@postgres/postgres \ + biboumi +``` -- cgit v1.2.3 From 044a1a0c8c34fc463066a52528cd59db6d206c2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Sat, 16 Dec 2017 20:36:15 +0100 Subject: Use a specific (0.4.2) pyasn1 version in the debian Dockerfile --- docker/biboumi-test/debian/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docker') diff --git a/docker/biboumi-test/debian/Dockerfile b/docker/biboumi-test/debian/Dockerfile index 65c964e..557face 100644 --- a/docker/biboumi-test/debian/Dockerfile +++ b/docker/biboumi-test/debian/Dockerfile @@ -46,7 +46,7 @@ RUN apt install -y g++\ 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 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==0.4.2 && cd slixmpp && python3 setup.py build && python3 setup.py install RUN useradd tester -m -- cgit v1.2.3 From a209e77fc2c189c251fa90eebdce0f16ff4f6f04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Fri, 26 Jan 2018 00:35:08 +0100 Subject: Rename a few CI things to a useful names --- docker/biboumi-test/archlinux/Dockerfile | 13 ------------- docker/packaging/archlinux/Dockerfile | 13 +++++++++++++ 2 files changed, 13 insertions(+), 13 deletions(-) delete mode 100644 docker/biboumi-test/archlinux/Dockerfile create mode 100644 docker/packaging/archlinux/Dockerfile (limited to 'docker') diff --git a/docker/biboumi-test/archlinux/Dockerfile b/docker/biboumi-test/archlinux/Dockerfile deleted file mode 100644 index 20f0343..0000000 --- a/docker/biboumi-test/archlinux/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -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/packaging/archlinux/Dockerfile b/docker/packaging/archlinux/Dockerfile new file mode 100644 index 0000000..20f0343 --- /dev/null +++ b/docker/packaging/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 -- cgit v1.2.3