Building WebHelpDesk in Docker

WebHelpDesk by SolarWinds is a ticketing system and asset tracking system. I use it specifically for its asset-tracking capabilities. One of its many perks is that it allows the aggregation of inventory from other databases through its Discovery Connections – a fact that I’ll make use of heavily in later posts.

In this post, I’m going to build WebHelpDesk into a Docker image, for portability and simplicity. This is based on the RHEL rpm installed on a CentOS 6 base.

The Dockerfile:

From the Dockerfile:

FROM centos:centos6  
ADD http://downloads.solarwinds.com/solarwinds/Release/WebHelpDesk/12.2.0/webhelpdesk-12.2.0-1.x86_64.rpm.gz /webhelpdesk.rpm.gz 
RUN gunzip -dv /webhelpdesk.rpm.gz
RUN yum install -y /webhelpdesk.rpm && rm /webhelpdesk.rpm && yum clean all
RUN cp /usr/local/webhelpdesk/conf/whd.conf.orig /usr/local/webhelpdesk/conf/whd.conf
RUN sed -i 's/^PRIVILEGED_NETWORKS=[[:space:]]*$/PRIVILEGED_NETWORKS=172.17.42.1/g' /usr/local/webhelpdesk/conf/whd.conf  
ADD run.sh /run.sh  
ADD supervisord.conf /home/docker/whd/supervisord.conf  
RUN yum install -y python-setuptools  
RUN easy_install supervisor  
RUN yum clean all  
EXPOSE 8081  
CMD ["/run.sh"]

We’re starting with CentOS 6, and building from there.

ADD http://downloads.solarwinds.com/solarwinds/Release/WebHelpDesk/12.2.0/webhelpdesk-12.2.0-1.x86_64.rpm.gz /webhelpdesk.rpm.gz 
RUN gunzip -dv /webhelpdesk.rpm.gz
RUN yum install -y /webhelpdesk.rpm && rm /webhelpdesk.rpm && yum clean all

First, ADD in the compressed RPM (Why is it compressed? I don’t know. According to support they have no plans to change that at this time) down, and then unzip it. Then use yum to install the RPM.

RUN cp /usr/local/webhelpdesk/conf/whd.conf.orig /usr/local/webhelpdesk/conf/whd.conf
Copy the default configuration into place.

RUN sed -i 's/^PRIVILEGED_NETWORKS=[[:space:]]*$/PRIVILEGED_NETWORKS=172.17.42.1/g' /usr/local/webhelpdesk/conf/whd.conf
This adds the Docker IP range to the list of privileged networks, thus giving any Docker IP access to update the database settings.

ADD run.sh /run.sh
ADD supervisord.conf /home/docker/whd/supervisord.conf
RUN yum install -y python-setuptools
RUN easy_install supervisor

We’re going to use supervisord to control and manage WebHelpDesk’s Tomcat-based web server. Supervisord will be in charge of starting the process and watching it to make sure it runs, which means that it will be the container’s primary process. The run.sh script is what will trigger the supervisord kickoff. We need to install supervisord using easy_install, which requires the Python setuptools.

EXPOSE 8081
By default, WebHelpDesk runs (unsecured) on port 8081. It can be configured to use port 8443 with SSL, but that’s a project for a later date.

CMD ["/run.sh"]
The CMD directive tells Docker to kick in the “run.sh” script on startup.

Build the Container:

You can find the repo for this project here. You can build the project yourself:
docker build -t name/whd .
Or you can pull the automated build from the Docker registry:
docker pull macadmins/whd

Running WebHelpDesk in a Docker container will be covered in the next post.

Leave a comment