api - Attach stdin of docker container via websocket -
i using chrome websocket client extension attach running container calling docker remote api this:
ws://localhost:2375/containers/34968f0c952b/attach/ws?stream=1&stdout=1
the container started locally machine executing jar in image waits user input. want supply input input field in web browser.
although able attach using api endpoint, encountering few issues - due lackluster understanding of ws endpoint bad documentation - resolve:
1) when sending data using chrome websocket client extension, frame appears transmitted on websocket according network inspection tool. however, process running in container waiting input receives sent data when websocket connection closed - @ once. standard behaviour? intuitively expect input sent process.
2) if attach stdin , stdout @ same time, docker deamon gets stuck waiting stdin attach, resulting in not being able see output:
[debug] attach.go:22 attach: stdin: begin [debug] attach.go:59 attach: stdout: begin [debug] attach.go:143 attach: waiting job 1/2 [debug] server.go:2312 closing buffered stdin pipe [error] server.go:844 error attaching websocket: use of closed network connection
i have solved opening 2 separate connections stdin , stdout, works, annoying. ideas on one?
thanks in advance!
Comments
Post a Comment