2013-11-09 02:43:41 -05:00
|
|
|
package docker
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/mitchellh/multistep"
|
2013-11-12 11:24:16 -05:00
|
|
|
"github.com/mitchellh/packer/common"
|
2013-11-09 02:43:41 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
type StepProvision struct{}
|
|
|
|
|
|
|
|
func (s *StepProvision) Run(state multistep.StateBag) multistep.StepAction {
|
|
|
|
containerId := state.Get("container_id").(string)
|
|
|
|
tempDir := state.Get("temp_dir").(string)
|
|
|
|
|
|
|
|
// Create the communicator that talks to Docker via various
|
|
|
|
// os/exec tricks.
|
|
|
|
comm := &Communicator{
|
|
|
|
ContainerId: containerId,
|
|
|
|
HostDir: tempDir,
|
|
|
|
ContainerDir: "/packer-files",
|
|
|
|
}
|
|
|
|
|
2013-11-12 11:24:16 -05:00
|
|
|
prov := common.StepProvision{Comm: comm}
|
|
|
|
return prov.Run(state)
|
2013-11-09 02:43:41 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *StepProvision) Cleanup(state multistep.StateBag) {}
|