From 6407a579f0b4b5a0502f5062a2733f75ebeb1946 Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Fri, 29 Mar 2019 11:21:07 -0700 Subject: [PATCH] Document why we need windows communicator in code --- builder/docker/windows_container_communicator.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/builder/docker/windows_container_communicator.go b/builder/docker/windows_container_communicator.go index dbb74f406..3db7bbfbb 100644 --- a/builder/docker/windows_container_communicator.go +++ b/builder/docker/windows_container_communicator.go @@ -12,6 +12,14 @@ import ( "github.com/hashicorp/packer/packer" ) +// Windows containers are a special beast in Docker; you can't use docker cp +// to move files between the container and host. + +// This communicator works around that limitation by reusing all possible +// methods and fields of the normal Docker Communicator, but we overwrite the +// Upload, Download, and UploadDir methods to utilize a mounted directory and +// native powershell commands rather than relying on docker cp. + type WindowsContainerCommunicator struct { Communicator }