- Official, automated image builds are published as `prosodyim/prosody` on Docker Hub.
- This commit updates links to the published image in `README.md`.
- Still mentioning the outdated `prosody/prosody` image, because they are both official accounts but have confusing naming.
- Adding or updating other documentation would also be helpful.
- The information page(s) for both Docker Hub images.
- Links to the outdated Docker Hub image, for example in the Github repository sidebar information.
- Links to alternative `Dockerfile` implementations are moved below the documentation for this repository.
Closes#72.
Usage example:
```shell
docker image pull prosodyim/prosody:13.0
podman image pull docker.io/prosodyim/prosody:13.0
```
See
- https://github.com/prosody/prosody-docker/issues/72
- https://hub.docker.com/r/prosodyim/prosody
- https://hub.docker.com/r/prosody/prosody
Problem is that the code appears to expect multiple returns from the
`_split()` function but it returns an array, so we unpack that
presumably 2-item array into the parts expected.
Fixes#77
This can be used to break the cache when we know the upstream package has
changed. In CI we will probably just put the build number here.
Even though it is not currently exposed anywhere, it is available as an
environment variable in all RUN commands following the ARG. This should be
enough to avoid reusing cached layers between builds.
Although cc88073a79 ("Fix signal handling") fixed the signal handling
and signals don't end up in `entrypoint.sh` anymore, there's still no
clean graceful shutdown. The reason is runuser. It runs as PID 1 and
prosody only runs as child process. A SIGTERM sent to runuser lets
runuser forward SIGTERM to the child process. However it does not wait,
but send SIGKILL right after it. (Confirmed by looking at runuser source
code in util-linux.)
The output on `docker stop [prosodycontainer]` is therefore:
Session terminated, killing shell...mod_posix warn Received SIGTERM
portmanager info Deactivated service 'c2s'
...killed.
The additional messages in between prosody log output come from runuser.
This is obviously no graceful shutdown.
Because prosody fordibs running as uid 0 (root) we have to run it as
unpriviledged user. The docker best practices recommend to use *gosu*
and gosu lists some alternatives. Instead of installing gosu to the
image, we use *setpriv* from the already installed util-linux now. The
version in Debian buster, on which the prosody image is based currently,
is recent enough to already contain setpriv.
After that, prosody itself runs with PID 1, but as unpriviledged user
now, and the output of `docker stop` looks like this:
mod_posix warn Received SIGTERM
portmanager info Deactivated service 'c2s'
general info Shutting down...
general info Shutdown status: Cleaning up
general info Shutdown complete
Link: https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#entrypoint
Signed-off-by: Alexander Dahl <post@lespocky.de>
This reverts commit 31d6d84433.
While tini successfully forwards signals, this leads to `runuser`
killing prosody now. The container does terminate in 10 seconds, so
Docker is happy and you could argue that actually fixes#68, but it's no
graceful shutdown. The revert is done because it's easier to apply a
real fix without tini.
tini [1] is a minimalistic PID 1 process. It correctly handles
the special jobs which PID 1 (or a reaper process in general)
needs to take care of in addition to correctly processing the
relevant signals.
Fixes#68.
[1]: https://github.com/krallin/tini
This patch add `exec` to replace the shell running the `entrypoint.sh`
script by Prosody executable.
This allows Prosody to catch and handle correctly signals, notably
SIGTERM and SIGINT. Without it, Docker can't stop correctly the
container, resulting in a 10 s delay before it kills it.