builder/docker: say when killing the container

This commit is contained in:
Mitchell Hashimoto 2013-11-09 19:17:27 -08:00
parent d8b29cd63b
commit c04d1cd57e
1 changed files with 4 additions and 1 deletions

View File

@ -44,10 +44,13 @@ func (s *StepRun) Cleanup(state multistep.StateBag) {
return
}
driver := state.Get("driver").(Driver)
ui := state.Get("ui").(packer.Ui)
// Kill the container. We don't handle errors because errors usually
// just mean that the container doesn't exist anymore, which isn't a
// big deal.
driver := state.Get("driver").(Driver)
ui.Say(fmt.Sprintf("Killing the container: %s", s.containerId))
driver.StopContainer(s.containerId)
// Reset the container ID so that we're idempotent