Docker Exec interactive vs not-interactive

I am trying to run an executable in my linux docker container.
When I do the following, it works perfectly:

root@emsmith:/# docker exec -it 1000 bash
root@592cb716a422:/# /folder/to/runMyStuff
…correct output…

However, I want to run this non-interactive which takes a few minutes then gives an exception:

root@emsmith:/# docker exec -t 1000 /folder/to/runMyStuff

Unhandled Exception: OutOfMemoryException.

If anyone has an idea why this might be happening I would love to hear it.

Just an idea: Would it be possible that /folder/to/runMyStuff calls itself recursively?

It does not call itself recursively, but it is a wrapper that calls various .dll’s

Can’t tell for certain without knowing more details about /folder/to/runMyStuff. But have you tried
docker exec -t 1000 bash -c /folder/to/runMyStuff

You might also log output and errors like this:
docker exec -t 1000 /folder/to/runMyStuff >/myStuffoutput.txt 2>myStuffErrors.txt

and check the logs when it gives the exception.

1 Like

Running with bash -c made no difference.

Piping the stdout and stderr also was not much help. The stderr file was empty and the stdout file just had “Unhandled Exception: OutOfMemoryException.”

My application is using dotnetcore, which I am starting to think is the issue. I am now getting the correct output from my application intermittently, about 1/10 times I run it it works.

That does look like a dotnetcore problem. Even the error message is from dotnetcore. This is interesting.