Docker Community Forums

Share and learn in the Docker community.

Docker Exec interactive vs not-interactive


(Emsmith) #1

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.


(Accetto) #2

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


(Emsmith) #3

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


(Raj Chaudhuri) #4

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.


(Emsmith) #5

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.


(Raj Chaudhuri) #6

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