Public | Automated Build

Last pushed: 11 days ago
Short Description
Build agents that monitor and act on your behalf. Your agents are standing by!
Full Description

Huginn for docker with multiple container linkage

This image runs a linkable Huginn instance.

There is an automated build repository on docker hub for cantino/huginn.

This was patterned after sameersbn/gitlab by ianblenke/huginn, and imported here for official generation of a docker hub auto-build image.

The scripts/init script generates a .env file containing the variables as passed as per normal Huginn documentation.
The same environment variables that would be used for Heroku PaaS deployment are used by this script.

The scripts/init script is aware of mysql and postgres linked containers through the environment variables:




Its recommended to use an image that allows you to create a database via environmental variables at docker run, like paintedfox / postgresql or centurylink / mysql, so the db is populated when this script runs.

If you do not link a database container, a built-in mysql database will be started.
There is an exported docker volume of /var/lib/mysql to allow persistence of that mysql database.

NOTE: If you do not export the volme, or use a linked database container, you cannot update Huginn without losing your data.

Additionally, the database variables may be overridden from the above as per the standard Huginn documentation:

DATABASE_ADAPTER #(must be either 'postgresql' or 'mysql2')

This script will run database migrations (rake db:migrate) which should be idempotent.

It will also seed the database (rake db:seed) unless this is defined:


This same seeding initially defines the "admin" user with a default password of "password" as per the standard Huginn documentation.

If you do not wish to have the default 6 agents, you will want to set the above environment variable after your initially deploy, otherwise they will be added automatically the next time a container pointing at the database is spun up.

The CMD launches Huginn via the scripts/init script. This may become the ENTRYPOINT later. It does take under a minute for Huginn to come up. Use environmental variables that match your DB's creds to ensure it works.


Simple stand-alone usage (use only for testing/evaluation as it can not be updated without losing data):

docker run -it -p 3000:3000 cantino/huginn

Use a volume to export the data of the internal mysql server:

docker run -it -p 3000:3000 -v /home/huginn/mysql-data:/var/lib/mysql cantino/huginn

To link to another mysql container, for example:

docker run --rm --name huginn_mysql \
    -e MYSQL_DATABASE=huginn \
    -e MYSQL_USER=huginn \
    -e MYSQL_PASSWORD=somethingsecret \
    -e MYSQL_ROOT_PASSWORD=somethingevenmoresecret \
docker run --rm --name huginn \
    --link huginn_mysql:mysql \
    -p 3000:3000 \
    -e HUGINN_DATABASE_NAME=huginn \
    -e HUGINN_DATABASE_PASSWORD=somethingsecret \

To link to another container named 'postgres':

docker run --name huginn_postgres \
    -e POSTGRES_PASSWORD=mysecretpassword \
    -e POSTGRES_USER=huginn -d postgres
docker run --rm --name huginn \
    --link huginn_postgres:postgres \
    -p 3000:3000 \
    -e HUGINN_DATABASE_PASSWORD=mysecretpassword \
    -e HUGINN_DATABASE_ADAPTER=postgresql \

The docker/multi-process folder also has a docker-compose.yml that allows for a sample database formation with a data volume container:

cd docker/multi-process ; docker-compose up

Environment Variables

Other Huginn 12factored environment variables of note, as generated and put into the .env file as per Huginn documentation. All variables of the .env.example can be used to override the defaults which a read from the current .env.example.

For variables in the .env.example that are commented out, the default is to not include that variable in the generated .env file.

Building on your own

You don't need to do this on your own, because there is an automated build for this repository, but if you really want:

docker build --rm=true --tag={yourname}/huginn .


The source is available on GitHub.

Please feel free to submit pull requests and/or fork at your leisure.

Docker Pull Command
Source Repository