3cubed
3cubed

Reputation: 21

`docker attach` in Google Compute Engine VM not showing output, cannot exit back to shell

I have a container with a python script that runs at startup, that I'm using to verify basic VM functionality.

    while True:
        print('Looping forever')
        time.sleep(3)
        pass

I have deployed this to a GCE VM instance with stdin buffer enabled.

What's not working:

I feel like there is something stupidly trivial that I've forgotten to set up.

===== EDIT =====

I found that even when I docker run locally, I don't see output and can't exit. I have to use kill in another terminal window to kill it.

When I run docker run -it $image in the VM's browser ssh terminal, I also see the output, which is good.

I think there's some behavior of docker attach that is working as intended, just not intuitive. I'd still like to achieve one of these goals:

Upvotes: 1

Views: 215

Answers (1)

3cubed
3cubed

Reputation: 21

Answering my own question for posterity: Need to set up cloud logging first

https://cloud.google.com/logging/docs/setup/python

Upvotes: 1

Related Questions