From 22cb2659e9204b65d7449af4c84ddcf9162c5cc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Tue, 25 Jul 2017 21:51:17 +0200 Subject: Move the Dockerfile inside an alpine subdirectory --- docker/biboumi/Dockerfile | 41 ----------------------------------- docker/biboumi/alpine/Dockerfile | 46 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 41 deletions(-) delete mode 100644 docker/biboumi/Dockerfile create mode 100644 docker/biboumi/alpine/Dockerfile (limited to 'docker') diff --git a/docker/biboumi/Dockerfile b/docker/biboumi/Dockerfile deleted file mode 100644 index 67f0f41..0000000 --- a/docker/biboumi/Dockerfile +++ /dev/null @@ -1,41 +0,0 @@ -# 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/alpine/Dockerfile b/docker/biboumi/alpine/Dockerfile new file mode 100644 index 0000000..da60796 --- /dev/null +++ b/docker/biboumi/alpine/Dockerfile @@ -0,0 +1,46 @@ +# This Dockerfile creates a docker image running biboumi +# +# It is built by compiling the sources and all its dependencies +# directly inside the image. +# This is the prefered way to build the release image, used by the +# end users, in production. + +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"] -- cgit v1.2.3 From f1306c62e0efd316e9daaccab67a49d4704f24e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Tue, 25 Jul 2017 21:53:56 +0200 Subject: Also move the README.md in that directory --- docker/biboumi/README.md | 68 ----------------------------------------- docker/biboumi/alpine/README.md | 68 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 68 deletions(-) delete mode 100644 docker/biboumi/README.md create mode 100644 docker/biboumi/alpine/README.md (limited to 'docker') diff --git a/docker/biboumi/README.md b/docker/biboumi/README.md deleted file mode 100644 index 4b9e1e5..0000000 --- a/docker/biboumi/README.md +++ /dev/null @@ -1,68 +0,0 @@ -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/alpine/README.md b/docker/biboumi/alpine/README.md new file mode 100644 index 0000000..4b9e1e5 --- /dev/null +++ b/docker/biboumi/alpine/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/ +``` -- cgit v1.2.3 From 6187423e6ed834570783ef3097a6ef73cc58107a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Wed, 26 Jul 2017 22:32:54 +0200 Subject: Aaaand move the biboumi.cfg file for docker --- docker/biboumi/alpine/Dockerfile | 2 +- docker/biboumi/alpine/biboumi.cfg | 6 ++++++ docker/biboumi/biboumi.cfg | 6 ------ 3 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 docker/biboumi/alpine/biboumi.cfg delete mode 100644 docker/biboumi/biboumi.cfg (limited to 'docker') diff --git a/docker/biboumi/alpine/Dockerfile b/docker/biboumi/alpine/Dockerfile index da60796..c1bf5fd 100644 --- a/docker/biboumi/alpine/Dockerfile +++ b/docker/biboumi/alpine/Dockerfile @@ -37,7 +37,7 @@ 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 +COPY ./biboumi.cfg /etc/biboumi/biboumi.cfg RUN chown -R biboumi:biboumi /etc/biboumi WORKDIR /home/biboumi diff --git a/docker/biboumi/alpine/biboumi.cfg b/docker/biboumi/alpine/biboumi.cfg new file mode 100644 index 0000000..98c5a9f --- /dev/null +++ b/docker/biboumi/alpine/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/biboumi/biboumi.cfg b/docker/biboumi/biboumi.cfg deleted file mode 100644 index 98c5a9f..0000000 --- a/docker/biboumi/biboumi.cfg +++ /dev/null @@ -1,6 +0,0 @@ -xmpp_server_ip=127.0.0.1 -port=5347 -db_name=/var/lib/biboumi/biboumi.sqlite -hostname=xmpp -password= -admin= -- cgit v1.2.3