From 27d847711c5e663d2fa3b2295f5f50c898783eb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Fri, 17 Feb 2017 14:58:23 +0100 Subject: docker: Add the XMPP_SERVER_IP option, and document the --network=host usage --- docker/biboumi/README.rst | 27 +++++++++++++++++++++++---- docker/biboumi/biboumi.cfg | 2 +- docker/biboumi/entrypoint.sh | 1 + 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/docker/biboumi/README.rst b/docker/biboumi/README.rst index fb4b212..f6d529d 100644 --- a/docker/biboumi/README.rst +++ b/docker/biboumi/README.rst @@ -5,7 +5,7 @@ Running ------- This image does not embed any XMPP server. You need to have a running XMPP -server (as an other docker container for example) first. +server first: as an other docker image, or running on the host machine. Assuming you have a running `prosody `_ container already running and @@ -22,6 +22,19 @@ docker run --link prosody:xmpp \ 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 --------- @@ -31,6 +44,7 @@ the container is started, using the following environment variables: * BIBOUMI_HOSTNAME: Sets the value of the *hostname* option. * BIBOUMI_SECRET: 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 is **xmpp**. All these variables are optional, but biboumi will probably fail to start if the hostname and secret are missing. @@ -47,9 +61,14 @@ docker run --link prosody:xmpp \ Linking with the XMPP server ---------------------------- -You can use the --link option to connect to any server, but it needs to be -called *xmpp*. For example, if you are using a container named ejabberd, you -would use the option *--link ejabberd:xmpp*. +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 ------- diff --git a/docker/biboumi/biboumi.cfg b/docker/biboumi/biboumi.cfg index fff6563..cc5df61 100644 --- a/docker/biboumi/biboumi.cfg +++ b/docker/biboumi/biboumi.cfg @@ -1,4 +1,4 @@ -xmpp_server_ip=xmpp +xmpp_server_ip=BIBOUMI_XMPP_SERVER_IP port=5347 db_name=/var/lib/biboumi/biboumi.sqlite hostname=BIBOUMI_HOSTNAME diff --git a/docker/biboumi/entrypoint.sh b/docker/biboumi/entrypoint.sh index a0c0508..4d00164 100644 --- a/docker/biboumi/entrypoint.sh +++ b/docker/biboumi/entrypoint.sh @@ -1,5 +1,6 @@ #!/bin/bash +sed -i s/BIBOUMI_XMPP_SERVER_IP/${BIBOUMI_XMPP_SERVER_IP:-xmpp}/ /etc/biboumi/biboumi.cfg sed -i s/BIBOUMI_HOSTNAME/${BIBOUMI_HOSTNAME:-biboumi.localhost}/ /etc/biboumi/biboumi.cfg sed -i s/BIBOUMI_ADMIN/${BIBOUMI_ADMIN:-}/ /etc/biboumi/biboumi.cfg sed -i s/BIBOUMI_SECRET/${BIBOUMI_SECRET:-missing_secret}/ /etc/biboumi/biboumi.cfg -- cgit v1.2.3