hashicorp / packer-plugin-docker

Packer plugin for Docker Builder
https://www.packer.io/docs/builders/docker
Mozilla Public License 2.0
30 stars 26 forks source link

File provisioner fails in 1.7.0 #22

Closed dimisjim closed 3 years ago

dimisjim commented 3 years ago

Hey there,

I was using 1.6.5 before and now just switched to 1.7.0 to test the new init and required_plugins features, thus I modified my template to look like this:

packer {
  required_version = ">= 1.7"

  required_plugins {

    docker = {
      version = "0.0.6"
      source  = "github.com/hashicorp/docker"
    }
  }
}

and kept the rest of it as it was. I did a packer init template.pkr.hcl which was successful, and then did a build. The shell provisioner worked fine but then when it reached the file one, it errored out like this:

==> docker.scenarioo: Uploading files/entrypoint.sh => /entrypoint.sh
==> docker.scenarioo: Provisioning step had errors: Running the cleanup provisioner, if present...
==> docker.scenarioo: Killing the container: e2e06f37ce42ffc1085b26f1a25a5d32c444cffa1f1bbb27a133e0ebf8f4bc3a
    docker.scenarioo: entrypoint.sh 0 B / 500 B [-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------]   0.00%
Build 'docker.scenarioo' errored after 5 seconds 507 milliseconds: [pos 6839]: readContainerLen: Unrecognized descriptor byte: hex: d7, decimal: 215

Am I missing something, or is this a known issue? The very same config worked fine prior to this upgrade.

nywilken commented 3 years ago

Hi there @dimisjim thanks for bubbling this up. It looks to be an issue with how the file provisioner is communicating with the split docker plugin. We are looking into this to see what is going on. In the mean, you can continue to use the docker plugin that is bundled with Packer v1.7.0 and soon v1.7.1 by dropping the required_plugins block for docker. The functionality between the bundled vs split plugin is the same, but the communicator with the bundled plugin is not exhibiting this issue.

Thanks again for opening up this issue.

nywilken commented 3 years ago

Hi @dimisjim this issue has been resolved in the latest release v0.0.7. If you update the required version in your configuration docker should work as expected. Please let us know if you run into any issues with the latest release. Cheers!

dimisjim commented 3 years ago

Can confirm that it works fine now.

Thanks!