1

Variations of this questions have been asked before, but I could not find an answer that works for me so far. I might miss some fundamental concept and would be thankful for advices or pointers that could help.

What I try to accomplish:

  • I have a legacy Windows-only application (binary) that I try to dockerize in a single container along my own .NET 5 application.
  • The legacy application ships with a custom communication library that I use to communicate with instances of the legacy application. The communication between the library and the legacy application is based on WCF NamedPipes (net.pipe).
  • I am aware that the problem could be solved by avoiding NamedPipes and go for a proper TCP channel. Unfortunately, this is out of my control.

The problem:

  • I use mcr.microsoft.com/windows/servercore as base image and managed to successfully run instances of the two applications in the container. The communication via NamedPipes does not work however.
  • Running both applications natively on my Windows 10 machine, works just fine.
  • I cannot dig deeper into the actual error, but it seems to be related to the failing NamedPipe communication.

What I tried:

  • Other posts suggest to enable the Windows feature for WCF NamesPipes, such as this one. So I added the following lines to the Dockerfile:
SHELL ["powershell"]
RUN Install-WindowsFeature -name NET-WCF-Pipe-Activation45
  • Other suggested lines did not apply to my case, as they seem IIS specific, such as this one:
New-ItemProperty 'IIS:\Sites\wcf' -name bindings -Value @{protocol='net.pipe';bindingInformation='localhost/folder1/folder2'} -Force;
  • I know the names of the NamedPipes created by the application, so I also tried to mount the NamedPipes into the container (although, I know this should not be required when communication inside the container only).
Ju-Ru
  • 11
  • 1
  • You can see if [this post](https://stackoverflow.com/questions/64343946/using-wcf-windows-named-pipes-with-docker-containers?rq=1) helps you. – Lan Huang Feb 10 '22 at 07:02
  • Thanks a lot for the pointer. I followed these steps before, without luck. Mounting the pipe into the container did not change the behavior. But you say, this should work for my inside-container use case as well, right? – Ju-Ru Feb 11 '22 at 09:38
  • In the meantime, I came across another post, which seems to imply that opening NamedPipes from within a container is not possible - please someone correct me if I am wrong! https://stackoverflow.com/questions/57772862/using-named-pipe-in-windows-containers-same-host/61239583#61239583 – Ju-Ru Feb 11 '22 at 13:39

0 Answers0