Docker image for Err, a chat-bot designed to be easily deployable, extensible and maintainable.
This image is based on the popular Alpine Linux project, available in the alpine official image. Alpine Linux is much smaller than most distribution base images (~5MB), and thus leads to much slimmer images in general.
- python3: A Alpine Linux image with Python 3 and the latest stable release of Err from PyPI.
- python2: A Alpine Linux image with Python 2 and the lastest working release of Err (4.2.2) for Python2 PyPI.
- latest: Same image as Python3 tag.
This container can be started in three different modes:
- shell: Start a bash session as the bot account (err).
- rootshell: Start a bash session as the root account.
- err: Start the bot itself. Any additional arguments passed here will be passed on to
err.py
.
For example, try: docker run --rm -it kriev/errbot-alpine err --help
To successfully run the bot, you will have to mount a config.py into the /err/
directory (--volume
option to docker run
).
Inside the container, /err/data/
has already been set aside for data storage. You should mount this directory as a data volume as well in order to de-couple your bot data from the container itself.
docker run -it -v /path/to/errbot/config.py:/err/config.py -v /path/to/errbot/data:/err/data kriev/errbot-alpine err
Some plugins require additional dependencies that may not be installed in the virtualenv by default. There are three ways to deal with this, listed from best practice to worst:
- Build your own image.
- Let Err install dependencies automatically by setting
AUTOINSTALL_DEPS = True
inconfig.py
. - Enter a running container manually (
docker exec --interactive --tty <container-name> shell
orrootshell
(if root is needed for OS related dependencies) where<container-name>
is the name listed bydocker ps
) and install with pip (gosu err /err/virtualenv/bin/pip install somepkg
).
/err
: Home directory of the user account for Err.config.py
is expected to go here./err/.ssh/
: The.ssh
directory of the bot user (you can mount private SSH keys into this directory if you need to install plugins from private repositories)./err/virtualenv/
: The virtualenv containing the Python interpreter and installed packages./err/data/
: A volume intended to store bot data (BOT_DATA_DIR
setting ofconfig.py
).
- The bot is run under its own user account (err), not as root.
- SSH is set up to automatically add unknown host keys (StrictHostKeyChecking no).
- Review the storage volume settings
This is a modified version of https://github.com/zoni/docker-err to run on Alpine. Credits for the bash scripts and base idea goes to him.