9 Commits

Author SHA1 Message Date
Lloyd Watkin 12dcdb0c64 Document adding a default
Fixes #1
2014-11-25 15:10:21 +00:00
Lloyd Watkin 56160ac766 Ignore errors 2014-11-25 15:05:04 +00:00
Lloyd Watkin a99fbcc814 Add a start up script 2014-11-25 15:04:08 +00:00
Lloyd Watkin 712f293389 Use a bash script to start prosody 2014-11-25 14:54:40 +00:00
Lloyd Watkin eb205258f8 Add port 5281 2014-11-24 14:27:32 +00:00
Lloyd Watkin 6f17c6ed1e Add link to prosody in the registry 2014-11-17 09:34:26 +00:00
Lloyd Watkin 7ea4bfbdae Document creating multiple tags from a single run 2014-11-15 15:16:11 +00:00
Lloyd Watkin e4cf4e52de Allow building of multiple tags from a single run 2014-11-15 15:15:58 +00:00
Lloyd Watkin 1d8b665909 Add 5281 as exposed port 2014-11-14 14:26:12 +00:00
4 changed files with 43 additions and 6 deletions
+4 -2
View File
@@ -17,12 +17,14 @@ RUN apt-get install -y openssl lua5.1 lua-expat lua-socket lua-filesystem \
lua-dbi-sqlite3 libssl1.0.0 lua-sec lua-zlib liblua5.1-expat0
COPY ./prosody.deb /data/prosody.deb
COPY ./start.sh /data/start.sh
RUN chmod 700 /data/start.sh
RUN dpkg -i /data/prosody.deb
# If using default configuration keep a process alive
RUN echo 'daemonize = false;' | cat - /etc/prosody/prosody.cfg.lua > temp && mv temp /etc/prosody/prosody.cfg.lua
EXPOSE 443 80 5222 5269 5347 5280
EXPOSE 443 80 5222 5269 5347 5280 5281
ENTRYPOINT prosodyctl start
ENTRYPOINT /data/start.sh
+19 -3
View File
@@ -1,6 +1,8 @@
# Prosody Docker
This is the Prosody Docker image building repository. Its only really designed to be used on the Prosody build server for pushing to the [Docker registry](https://registry.hub.docker.com/repos/prosody/).
This is the Prosody Docker image building repository. Its only really designed to be used on the Prosody build server for pushing to the [Docker registry](https://registry.hub.docker.com).
For images please see here: [Prosody on Docker](https://registry.hub.docker.com/u/prosody/prosody/).
It works by coping in a recently built `deb` file and running the install on the system.
@@ -12,6 +14,12 @@ Docker images are built off an __Ubuntu 14.04 LTS__ base.
docker run -d prosody/prosody --name prosody -p 5222:5222
```
On startup the image will create a default user of `admin@localhost` with password `password`. This can be changed by using environment variables `LOCAL`, `DOMAIN`, and `PASSWORD`. This performs the following action on startup:
prosodyctl register *local* *domain* *password*
Any error from this script is ignored. Prosody will not check the user exists before running the command (i.e. existing users will be overwritten). It is expected that [mod_admin_adhoc](http://prosody.im/doc/modules/mod_admin_adhoc) will then be in place for managing users (and the server).
### Ports
The image exposes the following ports to the docker host:
@@ -21,6 +29,7 @@ The image exposes the following ports to the docker host:
* __5269__: s2s port
* __5347__: XMPP component port
* __5280__: BOSH / websocket port
* __5281__: Secure BOSH / websocket port
Note: These default ports can be changed in your configuration file. Therefore if you change these ports will not be exposed.
@@ -45,6 +54,9 @@ docker run -d prosody/prosody:0.9 \
-p 5222:5222 \
-p 5269:5269 \
-p localhost:5347:5347 \
-e LOCAL=romeo \
-e DOMAIN=shakespeare.lit \
-e PASSWORD=juliet4ever \
-v /etc/prosody /data/prosody/configuration \
-v /var/log/prosody /logs/prosody \
-v /usr/lib/prosody-modules /data/prosody/modules
@@ -55,7 +67,11 @@ docker run -d prosody/prosody:0.9 \
Use the `build-docker.sh` script as follows:
```bash
./build-docker.sh /path/to/built-image.deb version_tag
./build-docker.sh /path/to/built-image.deb version_tag [, ...version_tag2, ...]
```
Where argument 1 is a pointer to the build `deb` file that you'd like to make an image from and 'version_tag' is the tag you'd like to push to the Docker registry with. After running the script will clean up any images generated (but not the base images - for efficiency purposes).
Where argument 1 is a pointer to the build `deb` file that you'd like to make an image from and 'version_tag' is the tag you'd like to push to the Docker registry with.
You can specify multiple tags by adding additional tag names to the end of the command. This is useful where a for example release 0.10.4 is made which also consitutes 'latest', '0.10-nightly', '0.10.4', '0.10' images.
After running the script will clean up any images generated (but not the base images - for efficiency purposes).
+9 -1
View File
@@ -13,8 +13,16 @@ fi
echo "Starting build..."
cp $1 ./prosody.deb
docker build -t prosody/prosody:$2 .
for i in "${@:3}"; do
echo "Also building tag $i"
docker build -t prosody/prosody:$i .
done
docker push prosody/prosody
echo "Cleaning up..."
docker rmi prosody/prosody:$2
rm ./prosody.deb
for i in "${@:3}"; do
echo "Also cleaning tag $i"
docker rmi prosody/prosody:$i
done
rm ./prosody.deb
+11
View File
@@ -0,0 +1,11 @@
#! /bin/bash
if [ ! "${LOCAL}" ] || [ ! "${PASSWORD}" ] || [ ! "${DOMAIN}" ] ; then
LOCAL="admin"
PASSWORD="password"
DOMAIN="localhost"
fi
prosodyctl register $LOCAL $DOMAIN $PASSWORD || true
prosodyctl start