In my previous post I delved into getting a munki repo with ssl client-server cert protecting up and running on a docker host. You can read that here.
So the next step I wanted to get up and running next to it was the great tool Munkireport-PHP. More than likely if you are looking into docker as an option for a munki repo server you have some experience with munkireport-php as a reporting tool for your fleet. I am not endorsing this as the only way or even a preferred way- I just wanted to see what it looked like to get it up and running on a docker host- and it was super easy (in comparison to getting a munki repo configured and up and running).
Sweet, lets get started. You could serve up just a munkireport-php on docker, I however tested both the previous posts setup and munkireport-php containers running on the same docker instance.
Pull the Munkireport-php Container
docker pull macadmins/munkireport-php
Then the magic happens.
Wait, magic? I want to know whats actually happening. So lets take a look at the macadmins/munkireport-php docker file.
FROM tutum/apache-php:latest ENV DEBIAN_FRONTEND noninteractive RUN apt-get update &amp;amp;amp;amp;&amp;amp;amp;amp; \ apt-get install -y php5-sqlite git WORKDIR / RUN rm -fr /app &amp;amp;amp;amp;&amp;amp;amp;amp; git clone https://github.com/munkireport/munkireport-php.git /app RUN mkdir -p /data/munkireport/db &amp;amp;amp;amp;&amp;amp;amp;amp; chmod -R 777 /data/munkireport RUN cp /app/config_default.php /app/config.php &amp;amp;amp;amp;&amp;amp;amp;amp; \ echo &quot;\$auth_config['admin'] = '\$P\$BDnkPOMPV0BMGL7YROrT9ITzwk3ZWz/';&quot; &amp;amp;amp;gt;&amp;amp;amp;gt; /app/config.php EXPOSE 80
This is really rad when we brake it down- dockerfiles do all the work for you! This pulls from tutum/apache-php the latest version with a debian_frontend, then runs apt-get install php5, sqlite and git. Then making a /data/munkireport for the data to be stored and some congifs/password hashes. Ending withe exposing port 80 to traffic.
Then it git clones the actual munkireport/munkireport-php which means you’re getting the latest build of munkireport-php.
Then making a /data/munkireport for the data to be stored and some configs/password hashe. Ending with exposing port 80 to traffic.
Pepijn Bruienne is responsible for this great autobuild repo. I want to explore more configuration of this site, perhaps even tying into LDAP or some authentication method so more than a local user can have access, and the least amount of manual lifting on user maintenance. But I digress.
Running the Container
docker pull macadmins/munkireport-php
*poof* We now have a live munkireport container.
Unfortunately I didn’t specify a name for the container, so it is now gloomy_visvesvaraya. If you’re not familiar with the naming convention of docker you can read more about it here.
Lets hit the the ip of the host on port 80. Or the fqdn if you have that setup, or setup via the host file on your testing machine.
Sweet, login looks good. A quick reference to the munkireport-php page shows us the version number is slightly older than the current release, which is 2.7.3 at this time. I still need to do a little research as to why this isn’t the current version, but rather 2.5.3. But if you’re fine with this version then lets take a look at the dashboard.
Alls well that ends well. I’ve tested enrolling a few machines agains this docker setup, both the munki-repo and the munkireport-php.
Existing Projects Referenced
Here is where I am headed next for this batch of projects, as time allows.
- More “depth” of this server
- Logging (report to logging server)
- SSL configs
- Automated startup/duplication/multiple locations
- Use network mounts for repos
Munki-report PHP(worked, seems simple enough)