Reputation: 21
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.
docker attach
to the active container.What's not working:
docker run $image
inside the ssh session, but I don't see any output and can't exit back to shell (same problem as with docker attach
above).docker run
.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
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