Search code examples
containerswindows-containernano-server

Windows Service installation on Docker Container


I am trying to port one of our Tomcat based Windows application to Windows Nano Server Container. The installation process includes two Windows Service installations - an ActiveMQ service and another Tomcat Service. This is achieved using two batch files provided with the product. In addition to installing the service, they also pass several arguments pertaining to JVM. Now the issue I am facing is I am not able to get these services installed on a Nano Server. The same Dockerfile works perfect and installs the product on Windows Server Core Container.

Observation: The services which get installed through batch files are dependent on two system components - Ancillary Function Driver for Winsock (Service name: afd) and TCP/IP Protocol Driver (Service Name: tcpip). This is something which I discovered on a VM where the product was installed when checking the service properties. I see that they are absent in a Nano Server Container but are present in Windows Server Core container. Could that be a reason? If yes, is there any way to get those services running on Nano Server?

I am at a loss on how to troubleshoot this issue. Are there any limitations on Nano Server Container when it comes to Windows Services?


Solution

  • Consider building your docker container from the ground up,

    • Determine and set your prerequisites
    • Install all of the dependencies first
    • Install the application and services in question

    (For additional information you can look at this wiki page.)

    The Nano server container is minimal and misses many windows default services, you’ll have to build most of them through Dockerfile yourself.

    The easiest method will be to do this manually on Nano server and confirm everything to be working in the docker container/image, and then later generate an automated build.