prasmussen / glot-run

API for running code inside docker containers
https://run.glot.io/
MIT License
147 stars 48 forks source link

Retrieve container stdout #39

Closed Dmunch04 closed 4 years ago

Dmunch04 commented 4 years ago

Hi!

I was wondering how exactly you're retrieving the Docker container stdout? Do you just read the log file? Because I can't really seem to find where you do that.

Thanks in advance!

prasmussen commented 4 years ago

I use the docker api. In this project I'm using the /containers/:id/attach endpoint to send stdin and read stdout/stderr. These days I would recommend using the websocket endpoint instead. It should be easier to use: https://docs.docker.com/engine/api/v1.40/#operation/ContainerAttachWebsocket