You can allocate a buffer for STDIN in the container runtime to keep the STDIN stream open in a container. If this is not set, reads from STDIN in the container always result in EOF.
Along with allocating a pseudo-TTY, keeping the STDIN stream open is necessary for establishing an interactive shell in the container and for the container to receive its standard input from a pipe.
From the console:
-
Go to the VM instances page.
-
Click the Create instance button to create a new instance.
-
Under the Container section, check Deploy container image.
-
Click Advanced container options.
-
Check Allocate a buffer for STDIN.