We are already using Docker and container based implementations during development, package builds and tests. This helps speed up development quite a lot next to the fancy Vagrant boxes. Since we’ve seen community members creating docker images for everything we thought we’d give it a try for our own official Docker container – our notebooks used in live demos at Icinga Camps certainly say thanks 😉
One problem arises – Docker containers are not made for running multiple applications, you would normally run each application inside its own container, and only export volumes and ports for communication links. A demo environment for Icinga 2 requires as least:
- Web server (httpd, apache2, etc)
- Database server (MariaDB, etc)
- Icinga 2 daemon
Furthermore we want to serve Icinga Web 2 as primary frontend and need to export port 80 for browser access. Even with SSH access for whatever comes to mind.
There’s already a Debian based Docker container using supervisord starting multiple applications in foreground. Taking this example whilst adding our own requirements into a CentOS7 based container (similar to the Vagrant boxes) leads us to our very own icinga2 Docker container.
It requires you to have at least Docker v1.6.0+ installed, then fire away and bind port 80 to your host’s port 3080:
$ sudo docker run -ti -p 3080:80 icinga/icinga2
Navigate to http://localhost:3080/icingaweb2/ and login using icingaadmin/icinga as credentials.
Keep in mind that the Docker container was made for test, development and demo purposes without any further production support.
If you’re planning to try Icinga Web 2 for example and want to test your own local patches, just mount the exported volumes like this:
$ sudo docker run -ti -p 3081:80 -v /usr/share/icingaweb2 /etc/icingaweb2 icinga/icinga2
There are additional volumes for /etc/icinga2 and /var/lib/icinga2 available. If you’re planning to modify the container image, you’ll find all required instructions inside the git repository.
On the long run, one might think of an Icinga 2 application cluster based on Docker containers. Who knows – happy testing & sending patches! 🙂
Hello,
I tried to start up a container for evaluating the capabilities of your platform but the configuration on the image given seems to be failing. Could you please give me some information regarding whether I can find an up-to-date version of your image?
I tried with the container listed in your website:
icinga/icinga2
Hi,
your error description is pretty vague – please join the community channels for further discussion and provide additional details.
Thanks,
Michael
worked only after I uncomment in /etc/php.ini date.timezone = “Europe/Berlin”
Please file a bug at https://dev.icinga.com/projects/icinga-tools 🙂
Note, the image does not seem to run on Docker-Machine (latest as of the time of this message) for OSX … yes, I know it uses a VirtualBox VM … not OSX, but I am running Xubuntu in VBox as well and the image works just fine in that case. Not sure if you want to look into that, but at least you know. I’ll just be running it on my Xubuntu VM. Thanks for the hard work.
Hi,
the Docker container runs just fine on El Capitan using the Docker toolbox, just tested it again. Please report issues directly to the dev tracker – the comments will be forgotten once in a while.
Kind regards,
Michael
Hi, I noticed an issue with supervisord.conf where it try to bind /run instead of /var/run and it makes the container to failed to initialize and stay up.
I fixed the file content/etc/supervisord.conf on my git repo
https://github.com/ocontant
Can you send us a PR for our repository please? I’ll gladly review and apply your fix 🙂