28 Commits

Author SHA1 Message Date
Matthew Wild 21b5e2d19b Create directory for pidfile (usually created by init script) 2019-01-14 11:43:13 +00:00
Matthew Wild 4de30316aa Add lua5.2 for compatibility with 0.11 packages 2019-01-14 11:42:51 +00:00
Matthew Wild a60be883e9 Fix README to state new distribution base 2019-01-14 11:31:41 +00:00
Matthew Wild 72bf20f29f Update Dockerfile to Debian stretch 2019-01-14 11:28:19 +00:00
Matthew Wild 933be62950 README: Update to clarify intended usage of this repository 2018-04-26 18:24:58 +01:00
Kim Alvefur b186acf8ff Remove redundant LuaExpat package 2017-10-20 03:40:34 +02:00
Kim Alvefur 01bbe56547 Explicitly install some base requirements
These are in the Prosody debian package dependencies.
2017-10-20 03:39:45 +02:00
Kim Alvefur 67de3d1ecc Merge pull request #30 from chrw/fix-ca-certificates
Install ca-certificates package to fix s2s SSL errors.
2017-01-23 14:08:34 +01:00
Christian Wolff df16f5af7e Install ca-certificates package to fix s2s SSL errors. 2016-08-08 12:58:44 +02:00
Matthew Wild b98fdd49f4 build-docker.sh: Some small improvements for parameter handling 2016-03-11 17:37:41 +00:00
Matthew Wild c095ddd323 Dockerfile: chmod 755 the entrypoint, so we don't depend on the permissions of the build system, fixes #27 2016-03-11 15:51:35 +00:00
Matthew Wild 6d139045cf Merge pull request #28 from prosody/27-entrypoint.sh
Make `entrypoint.sh` executable
2016-03-09 11:13:37 +00:00
Lloyd Watkin b31d7c913e Make entrypoint.sh executable
Fixes #27
cc @mwild1
2016-03-09 08:52:23 +00:00
Matthew Wild d346e0912e Install lua-bitop, fixes #24 2016-02-04 19:24:01 +00:00
Matthew Wild 8bbb02e228 entrypoint.sh: If a command is passed to the image, run prosodyctl instead 2016-02-04 19:19:17 +00:00
Matthew Wild bed0d8e598 Run as user 'prosody', and run prosody instead of prosodyctl. Also set __FLUSH_LOG environment variable to tell Prosody it needs to flush its logs after writing. Fixes #23 and fixes #25. 2016-02-04 19:17:11 +00:00
Lloyd Watkin 82e59c9091 Merge pull request #19 from SamWhited/patch-1
Remove duplicate lua-zlib install line.
2015-10-26 09:08:37 +00:00
Sam Whited 2b420fa628 Remove duplicate lua-zlib install line. 2015-10-23 13:50:25 -05:00
Lloyd Watkin 9cbebe220d Merge pull request #14 from hudon/patch-1
Update README.md
2015-03-31 09:07:48 +02:00
James Hudon ef57949ed1 Update README.md 2015-03-30 15:37:43 -07:00
Lloyd Watkin b0f191cbd3 Merge pull request #13 from dwilson6/log-volume-doc-update
Update log volume documentation with note about permissions
2015-03-23 08:33:06 +00:00
Devin Wilson f84c37d808 Update log volume documentation with note about permissions 2015-03-20 10:00:41 -06:00
Lloyd Watkin da004da054 Volume mounting documentation fixes 2015-03-16 14:57:01 +00:00
Lloyd Watkin 7f9f2ca6ab Fix documentation
See #11
2015-03-15 15:48:51 +00:00
Lloyd Watkin d429b2ca59 Merge pull request #2 from DexterTheDragon/improve_dockerfile
Cleanup the Dockerfile
2015-01-01 21:30:46 +00:00
Lloyd Watkin 8c69d7f200 Merge pull request #4 from lloydwatkin/readme-fix
Fix README.md for running Prosody image
2014-12-20 22:11:06 +00:00
Lloyd Watkin 6629d6cf75 Fix README.md for running Prosody image
See #3
2014-12-20 22:10:39 +00:00
Kevin Carter 1b1f0ed951 Cleanup the Dockerfile
- Reduce the build steps to reduce the number and size of intermediate images
- Set the logging to stdout by default
- Remove default user create, but still allow optional user creation
- Fix entrypoint command setup
2014-12-07 20:02:23 -07:00
6 changed files with 84 additions and 49 deletions
+41 -18
View File
@@ -3,28 +3,51 @@
# Based on ubuntu
################################################################################
FROM ubuntu:14.04
FROM debian:9
MAINTAINER Lloyd Watkin <lloyd@evilprofessor.co.uk>
MAINTAINER Prosody Developers <developers@prosody.im>
RUN mkdir /data
WORKDIR /data
# Some dependencies in stretch are not suitable for Prosody 0.11.x, so add our repo
RUN echo "deb http://packages.prosody.im/debian stretch main" > /etc/apt/sources.list.d/prosody.list
ADD prosody_packages.gpg /etc/apt/trusted.gpg.d/prosody.gpg
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y openssl lua5.1 lua-expat lua-socket lua-filesystem \
libidn11 lua-event lua-zlib lua-dbi-mysql lua-dbi-postgresql \
lua-dbi-sqlite3 libssl1.0.0 lua-sec lua-zlib liblua5.1-expat0
# Install dependencies
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
lsb-base \
adduser \
libidn11 \
libssl1.1 \
lua-bitop \
lua-dbi-mysql \
lua-dbi-postgresql \
lua-dbi-sqlite3 \
lua-event \
lua-expat \
lua-filesystem \
lua-sec \
lua-socket \
lua-zlib \
lua5.1 \
lua5.2 \
openssl \
ca-certificates \
ssl-cert \
&& rm -rf /var/lib/apt/lists/*
COPY ./prosody.deb /data/prosody.deb
COPY ./start.sh /data/start.sh
# Install and configure prosody
COPY ./prosody.deb /tmp/prosody.deb
RUN dpkg -i /tmp/prosody.deb \
&& sed -i '1s/^/daemonize = false;\n/' /etc/prosody/prosody.cfg.lua \
&& perl -i -pe 'BEGIN{undef $/;} s/^log = {.*?^}$/log = {\n {levels = {min = "info"}, to = "console"};\n}/smg' /etc/prosody/prosody.cfg.lua
RUN chmod 700 /data/start.sh
RUN dpkg -i /data/prosody.deb
RUN mkdir -p /var/run/prosody && chown prosody:prosody /var/run/prosody
# 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
COPY ./entrypoint.sh /entrypoint.sh
RUN chmod 755 /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
EXPOSE 443 80 5222 5269 5347 5280 5281
ENTRYPOINT /data/start.sh
EXPOSE 80 443 5222 5269 5347 5280 5281
USER prosody
ENV __FLUSH_LOG yes
CMD ["prosody"]
+24 -14
View File
@@ -1,23 +1,31 @@
# Prosody Docker
# Docker build scripts for Prosody build server
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).
This is the Prosody Docker image building repository. It is used by our build server to build and publish Docker images for stable releases and nightly builds.
For images please see here: [Prosody on Docker](https://registry.hub.docker.com/u/prosody/prosody/).
**Note:** Using this Dockerfile outside of our build server is not a supported use-case. There are many
alternative Dockerfiles for Prosody available which can be used for this:
It works by coping in a recently built `deb` file and running the install on the system.
- [OpusVL/prosody-docker](https://github.com/OpusVL/prosody-docker/)
- [unclev/prosody-docker-extended](https://github.com/unclev/prosody-docker-extended)
## Running
## Published images
Docker images are built off an __Ubuntu 14.04 LTS__ base.
For images please see here: [Prosody on Docker](https://hub.docker.com/r/prosody/prosody/).
## Running
It works by copying in a recently built `deb` file and running the install on the system.
Docker images are built off an __Debian 9 (stretch)__ base.
```bash
docker run -d prosody/prosody --name prosody -p 5222:5222
docker run -d --name prosody -p 5222:5222 prosody/prosody
```
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:
A user can be created 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
@@ -43,6 +51,7 @@ Volumes can be mounted at the following locations for adding in files:
* __/var/log/prosody__:
* Log files for prosody - if not mounted these will be stored on the system
* Note: This location can be changed in the configuration, update to match
* Also note: The log directory on the host (/logs/prosody in the example below) must be writeable by the prosody user
* __/usr/lib/prosody-modules__ (suggested):
* Location for including additional modules
* Note: This needs to be included in your config file, see http://prosody.im/doc/installing_modules#paths
@@ -50,16 +59,17 @@ Volumes can be mounted at the following locations for adding in files:
### Example
```
docker run -d prosody/prosody:0.9 \
docker run -d \
-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
-v /data/prosody/configuration:/etc/prosody \
-v /logs/prosody:/var/log/prosody \
-v /data/prosody/modules:/usr/lib/prosody-modules \
prosody/prosody:0.9
```
## Building
@@ -70,7 +80,7 @@ Use the `build-docker.sh` script as follows:
./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.
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.
+6 -6
View File
@@ -1,4 +1,4 @@
# /bin/bash
#!/bin/bash
if [[ -z "$1" ]]; then
echo "Usage: ./build-docker.sh def_file_name version_number"
@@ -11,18 +11,18 @@ if [[ -z "$2" ]]; then
fi
echo "Starting build..."
cp $1 ./prosody.deb
docker build -t prosody/prosody:$2 .
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 .
docker build -t prosody/prosody:"$i" .
done
docker push prosody/prosody
echo "Cleaning up..."
docker rmi prosody/prosody:$2
docker rmi prosody/prosody:"$2"
for i in "${@:3}"; do
echo "Also cleaning tag $i"
docker rmi prosody/prosody:$i
docker rmi prosody/prosody:"$i"
done
rm ./prosody.deb
Executable
+13
View File
@@ -0,0 +1,13 @@
#!/bin/bash
set -e
if [[ "$1" != "prosody" ]]; then
exec prosodyctl $*
exit 0;
fi
if [ "$LOCAL" -a "$PASSWORD" -a "$DOMAIN" ] ; then
prosodyctl register $LOCAL $DOMAIN $PASSWORD
fi
exec "$@"
Binary file not shown.
-11
View File
@@ -1,11 +0,0 @@
#! /bin/bash
if [ ! "${LOCAL}" ] || [ ! "${PASSWORD}" ] || [ ! "${DOMAIN}" ] ; then
LOCAL="admin"
PASSWORD="password"
DOMAIN="localhost"
fi
prosodyctl register $LOCAL $DOMAIN $PASSWORD || true
prosodyctl start