Make sure instances have unique names.
Make sure we don't return an old docker client.
This commit is contained in:
@@ -15,6 +15,7 @@ import (
|
||||
"github.com/play-with-docker/play-with-docker/pwd/types"
|
||||
"github.com/play-with-docker/play-with-docker/router"
|
||||
"github.com/play-with-docker/play-with-docker/storage"
|
||||
"github.com/rs/xid"
|
||||
)
|
||||
|
||||
type DinD struct {
|
||||
@@ -58,7 +59,7 @@ func (d *DinD) InstanceNew(session *types.Session, conf types.InstanceConfig) (*
|
||||
}
|
||||
conf.Hostname = nodeName
|
||||
}
|
||||
containerName := fmt.Sprintf("%s_%s", session.Id[:8], conf.Hostname)
|
||||
containerName := fmt.Sprintf("%s_%s", session.Id[:8], xid.New().String())
|
||||
opts := docker.CreateContainerOpts{
|
||||
Image: conf.ImageName,
|
||||
SessionId: session.Id,
|
||||
|
||||
Reference in New Issue
Block a user