1
0
mirror of https://github.com/bingohuang/docker-labs.git synced 2025-10-04 17:33:21 +08:00

Allow to specify image new when creating instances (#84)

This commit is contained in:
Marcos Nils
2017-04-11 14:01:15 -03:00
committed by GitHub
parent 35775c2083
commit c511737136
2 changed files with 10 additions and 3 deletions

View File

@@ -91,8 +91,11 @@ func getDindImageName() string {
return dindImage
}
func NewInstance(session *Session) (*Instance, error) {
log.Printf("NewInstance - using image: [%s]\n", dindImage)
func NewInstance(session *Session, imageName string) (*Instance, error) {
if imageName == "" {
imageName = dindImage
}
log.Printf("NewInstance - using image: [%s]\n", imageName)
instance, err := CreateInstance(session, dindImage)
if err != nil {
return nil, err