added check for docker backend
This commit is contained in:
parent
36c1e8d838
commit
ae59b81f44
|
@ -118,6 +118,10 @@ func (p *Provisioner) Prepare(raws ...interface{}) error {
|
||||||
errs = packer.MultiErrorAppend(errs, fmt.Errorf("backend: %s must be a valid backend", p.config.Backend))
|
errs = packer.MultiErrorAppend(errs, fmt.Errorf("backend: %s must be a valid backend", p.config.Backend))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if p.config.Backend == "docker" && p.config.Host == "" {
|
||||||
|
errs = packer.MultiErrorAppend(errs, fmt.Errorf("backend: host must be specified for docker backend"))
|
||||||
|
}
|
||||||
|
|
||||||
if p.config.Host == "" {
|
if p.config.Host == "" {
|
||||||
p.config.Host = "127.0.0.1"
|
p.config.Host = "127.0.0.1"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue