When I run "docker-compose" via remote powershell, it always throws below exception. It's not a powershell exception. When I run the "docker-compose" on local machine powershell, it works fine.
docker-compose : Building web
+ CategoryInfo : NotSpecified: (Building web:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
My environment is a Windows physical host, then create a VM on top of it, on the VM install "docker-compose". From physical host, I use remote powershell "Enter-PSSession -VMname )get-vm).Name -Credential administrator" to connect to the VM. Then I tried "docker-compose -f docker-compose.yml build" or just "docker-compose", the exception thrown. My docker-compose.yml is a very simple one and it works fine on local powershell.
My simple docker-compose.yml is as below:
version: '3'
services:
web:
build: .
as of Dockerfile:
FROM windowsservercore
RUN cmd.exe /c echo test > c:/test.txt
Looks like the same issue: https://stackoverflow.com/questions/2095088/error-when-calling-3rd-party-executable-from-powershell-when-using-an-ide
I'm afraid this is out of our hands, but you might be able to try one of the suggestions in that thread and see if it helps.
Thanks. Yes, it's the same issue. I've workaround the exception with the solution in the thread. Thanks for the help.
I don't really see why this is out of your hands. As far as I understand it powershell is converting standard error output to ErrorRecords and adding them to the powershell error stream.
I suppose the question is why are you writing to the standard error when there is no error?
Most helpful comment
I don't really see why this is out of your hands. As far as I understand it powershell is converting standard error output to ErrorRecords and adding them to the powershell error stream.
I suppose the question is why are you writing to the standard error when there is no error?