mirror of
https://github.com/bingohuang/docker-labs.git
synced 2025-07-14 18:27:25 +08:00
If instance doesn't exist don't try to connect to its terminal
This commit is contained in:
parent
b5e016e6f5
commit
6d967441ac
2
build.sh
2
build.sh
@ -1,3 +1,3 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
docker build -t builder .&& docker run --rm builder | sudo docker build -t franela/play-with-docker:master -
|
docker build -t builder .&& docker run --rm builder | sudo docker build -t franela/play-with-docker:latest -
|
||||||
|
@ -25,7 +25,7 @@ func NewClient(so socketio.Socket, session *Session) *Client {
|
|||||||
so.On("terminal in", func(name, data string) {
|
so.On("terminal in", func(name, data string) {
|
||||||
// User wrote something on the terminal. Need to write it to the instance terminal
|
// User wrote something on the terminal. Need to write it to the instance terminal
|
||||||
instance := GetInstance(session, name)
|
instance := GetInstance(session, name)
|
||||||
if len(data) > 0 {
|
if instance != nil && len(data) > 0 {
|
||||||
instance.Conn.Conn.Write([]byte(data))
|
instance.Conn.Conn.Write([]byte(data))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user