Gcc container logs empty

Good morning!

I’m using the gcc official docker image to build and run c/c++ code, I want to retrieve the result of the execution of the source code using the logs command "docker container logs ", but it seems that the logs file always empty and by typing the logs command in the terminal nothing is shown up, tried attaching the stdout and stderr with the flag -a while creating the container but nothing has changed with the logs, always empty

my question is how I can retrieve the logs of the container built with the gcc image.

the command I’m using :
$ docker run -v “$PWD”:/usr/src/myapp -w /usr/src/myapp gcc:4.9 gcc -o myapp myapp.c && ./myapp

1 Like