Using Spotify Docker Plugin on Windows

So recently I have been looking into using Docker to automate parts of my testing and deployment, Using my lightweight CEP component ( that uses Siddhi under the covers as a basis to develop my skills in Continuous Integration / Deployment.

Currently using Windows 10 on my personal laptop and never one to give up a challenge, I finally got Docker Toolbox running on Windows with version 1.8.2, with boot2docker and Docker Quickstart Terminal.

My next goal was to configure Docker builds directly to my boot2docker VM using Spotify’s Docker Maven Plugin ( as a step towards Continuous Integration / Deployment. The idea being whenever I run the deploy phase of my Maven build, a Docker image of my software would be built, ready to run immediately afterwards.

This is the maven configuration I used within my “runner” module’s pom.xml:

            <entryPoint>["java", "-jar", "/app/${}.jar"]</entryPoint>
            <!-- copy the service's jar file from target into the root directory of the image -->

I was trying to run it within IntelliJ on Windows, and was getting the following error:

Docker - Socket Write Error

Reading the Spotify Docker readme on GitHub states that it uses the DOCKER_HOST environment variable to determine the location of the Docker Daemon, and if this isn’t set it uses localhost:2375. So I tried setting this to the IP of the VM.

20151108 Docker 7

Unsuccessful again with this error:

Docker Error 2

This hadn’t worked either. Next thing to do was ssh onto the boot2docker VM and do a “netstat -apn” command, to see what ports Docker was listening on

Docker Machine Netstat

Docker was actually listening on 2376, not 2375! So after changing this I got back to the Socket write error from previous attempts.

A quick Google for this brought a bug up for the plugin (, mentioning other environment variables that potentially needed setting up, but at this point I didn’t know if they’d fix my specific problem, or even if they did what to set them to.

So next thing I tried to do was go back to Docker basics and build an image of my Spring Boot uberjar using a standard Dockerfile (completely outside of Maven):

FROM nimmis/java:oracle-8-jdk

ADD smalldata-cep-runner-1.0-SNAPSHOT.jar /app/smalldata-cep-runner.jar

CMD ["java", "-jar", "/app/smalldata-cep-runner.jar"]

Then from within the Docker Quickstart Terminal I was able to run this command within the folder that had my Dockerfile in it: “docker build -t foyst/smalldata-cep .”

This successfully built my image in my boot2docker VM, which I could then run with “docker run –rm -p 8080:8080 foyst/smalldata-cep”

Ok, so using Vanilla Docker build I could successfully create an image, happy days! So from there I moved on to running “mvn docker:build” from PowerShell…

Still an error. Then it occurred to me to try “mvn docker:build” from the Docker Quickstart Terminal:

20151108 Docker 5

Success!! So what’s the difference? Eventually it occurred to me that the Docker Quickstart Terminal must somehow be configured out of the box to communicate with the boot2docker VM. So I started focusing my search on that

Always review the documentation, this came in handy:

This allowed my to actually configure the shell of my choice (Powershell), and knowing how that worked I could then apply the same to my IntelliJ configuration.

20151108 Docker 6

Using Docker in Windows is still quite a PITA, but now the client works natively on Windows and you understand what goes on behind the scenes it’s possible to get it working quite nicely.

Next I will be looking into automated builds and deployments using a combination of GitHub, Jenkins and Docker…

Docker Toolbox and COMODO Internet Security

So after a couple of hours fighting trying to get the latest Docker Toolbox (1.8.2b) installed on my Windows laptop, I thought I’d share my adventure!

tl;dr – disable ALL of your security software whilst installing. COMODO’s HIPS module was preventing changes being made to the file system, even though I thought I’d closed COMODO (right click and close) it was still interfering. Disabling this explicitly through the UI allowed me to install Docker Toolbox.


So after opening the DockerToolbox-1.8.2b.exe and allowing all of the requests coming through COMODO, I get this error message before any sight of a Docker Installer UI:

Docker Toolbox Install Error


After clicking OK the installer drops out, and I get another request from COMODO for the Docker install to modify a file.

So after repeating this frustrating loop a couple of times, I turned off COMODO internet security by right clicking the COMODO icon in the notifications area, and selecting Exit. This allowed me to get a bit further in the install right up to starting the install process.

Then the pain arrives…

MoveFile Failed Code 5 Access Denied – whilst trying to configure the uninstaller for Docker (the first thing that the installer does). So I aborted at this point and googled for that error message.

Nothing specific to Docker, however as I suspected it’s quite a general error message, which returned support posts for a number of other app installs all suffering the same issue. And they all confirmed the same thing – disable your anti-virus and security software.

Just to double check, I tried installing the Toolbox within a Windows 8.1 VM I use for specific development (and with no security software installed), and of course it was fine in there.

As I’d seen a couple of the support posts mention HIPS modules within security software being the culprit, I tried disabling COMODO’s HIPS module specifically (without turning the whole thing off)

Worked first time after that, COMODO raised an alarm about a threat being detected from the installer, but I suspect it was a false-positive so let it carry on. Can now say it works fine on my machine :)


Sometimes trying to be over-secure can be a right PITA…

WCF or ASP.NET Web API – Which to use?!

Found this interesting article when deciding whether to go with WCF or the newer ASP.NET Web API framework when creating new web services. the Web API looks good as the way to go when creating RESTful services, without all the complex and verbose configuration that comes with WCF.

However, along with that you lose the extra configuration WCF provides you with, such as multiple transport types, duplex communication, message queues etc. So it’s definitely worth considering what the service will be used for before committing to one of them.

Repeating Matrix Column Headers in Reporting Services

Today my afternoon was spent going through a set of standard reports used by some of the customers that I work with, checking layout, formatting etc.

I’d noticed that when a matrix spans over multiple pages, the column headers are not repeated. Foolishly I thought this will be a simple fix, surely just right clicking the group on the group selection at the bottom of report builder, then selecting repeat header…

However, sometimes this isn’t the case, turns out you need to dig a little deeper than that!

Try this…

Select the matrix in question, click the down arrow near row groups and column groups at the bottom, and select ‘Advanced Mode’.

Then select the static row groups that correspond to your column headers, go to it’s properties, and set the ‘RepeatOnNewPage’ property to true.

Works for me, hope it does for you!

This link explains how to do it:

COM woes – Retrieving COM class factory failed due to the following error: 80040154

I spent ages trying to figure out this problem, when trying to reference Microsoft Office Interop libraries in my project (For manipulating an Excel file programmatically).

Turns out, the dlls I was trying to reference were 32-bit, and the platform my project was set to run on was 64-bit. As I was building this project on a 64-bit machine, Visual Studio set the default platform to be 64-bit.

This is a simple fix: Go to the “Project” menu, select “Properties”, then click the “Build” tab on the side. From here you just need to select x86 from the Platform combo box and rebuild your project. Sorted!

Create SQL Table from .NET Datatable in C#

In one of my recent projects I needed to generate a datatable in C# whose fields could vary depending on which properties of a variable needed to be exported from the system. It needed to be able to generate the SQL CREATE TABLE script on the fly and create the table in the database, and then populate the table with the data to export, either using a SqlBulkCopy object or on a row-by-row basis.

The tutorial below provides a good code base to developing this kind of functionality, as well as providing a link to a similar project on MSDN.

Dynamically Build SQL MERGE statement in SSIS

I came across this the other day, when I was looking at using the SQL MERGE statement to replicate the functionality of the Slowly Changing Dimension task in SSIS. There are many benefits to using MERGE instead of the SSIS task, one of my favourites being only having to run 1 SQL statement for the whole task, instead of one for each Lookup, and then subsequent UPDATE or INSERT statement.

This link however, takes it one step further by dynamically building the MERGE statements to use in your ETL. This removes the need to manually update scripts when the table schema changes, such as adding new fields, and makes it a great candidate for quick deployment of Slowly Changing Dimension tasks.

Debugging MDX Queries from SSRS using Profiler and SQL Management Studio

At work recently I came across the need to assess the MDX queries used by some of the reports on our reporting server, along with the parameters that were passed into it (as most of the queries are powered by parameters that are passed into the MDX by parent reports)

Unfortunately, you can’t use SSMS to run parameterised MDX queries like you can in SSRS, but the tutorial below gives a good example using SQL Server Profiler, capturing traces of executed queries by SSRS along with the parameter values used. From here you can just paste the MDX into SSMS, replace the parameter names with the values used and presto!