0

when i do

docker run consoleapp

I get the output "Hello World"

but when i want to run this program in a docker-compose with -d then nothing happens:

Starting AA... done
Starting BB ... done
Starting consoleapp ... done

Is there a way to see the output?

Loading
  • 1,098
  • 1
  • 12
  • 25
  • Possible duplicate of [Getting console output from Docker container](https://stackoverflow.com/questions/33083385/getting-console-output-from-docker-container) – David Maze Aug 17 '18 at 17:56

1 Answers1

1

Try running compose without -d, it will show you the stdout of the containers on the screen, with -d it daemonizes the containers -
$ docker-compose up

In case you want to daemonize it, you can use service name defined in docker compose to get the container logs like -
$ docker-compose up -d ; docker-compose logs consoleapp

Ref - https://docs.docker.com/compose/reference/logs/

vivekyad4v
  • 13,321
  • 4
  • 55
  • 63