1
0
mirror of https://github.com/bingohuang/docker-labs.git synced 2025-07-16 03:07:26 +08:00

Change default dind image and prevent session panic

This commit is contained in:
Marcos Lilljedahl 2016-11-15 01:46:29 -03:00
parent cab8eef9da
commit 939c045198
2 changed files with 4 additions and 2 deletions

View File

@ -41,7 +41,7 @@ func init() {
func getDindImageName() string {
dindImage := os.Getenv("DIND_IMAGE")
defaultDindImageName = "docker:1.12.3-dind"
defaultDindImageName = "franela/pwd-1.12.3-experimental-dind"
if len(dindImage) == 0 {
dindImage = defaultDindImageName
}

View File

@ -66,7 +66,9 @@ func CloseSession(s *Session) error {
wsServer.BroadcastTo(s.Id, "session end")
log.Printf("Starting clean up of session [%s]\n", s.Id)
for _, i := range s.Instances {
i.conn.Close()
if i.conn != nil {
i.conn.Close()
}
if err := DeleteContainer(i.Name); err != nil {
log.Println(err)
return err