chef-boneyard / chef-provisioning-docker

Docker provisioner for chef-provisioning
Apache License 2.0
92 stars 41 forks source link

volumes are not mounting properly #85

Closed jgoulah closed 8 years ago

jgoulah commented 8 years ago

using the machine resource, I define volumes such as: :volumes => ["/Users/testuser:/home/testuser"],

The docker run command that is issued does mount the volumes (if I run it manually it works), but then in the DockerContainerMachine::converge function the container is renamed and the volumes are lost (the directory exists but is not mounted, no files)

jgoulah commented 8 years ago

I'll also note that I think it was broken in this commit https://github.com/chef/chef-provisioning-docker/commit/07753c4520d3364124dbdca434cd102e471b8bb4#diff-82b3f52918fe92819012dcf0d787c347

If I change the code back to transport.execute it seems to keep the volumes mounted

jgoulah commented 8 years ago

At this point I can confirm when transport.container.commit is called none of the options are getting passed, and subsequently when image.run is called none of these options exist on the container, therefore the volumes are missing

I am not sure on the correct fix, I think we want to invoke Docker::Image.create with the correct options OR just call transport.execute as it was doing previous to the change above. Look forward to hearing thoughts

jgoulah commented 8 years ago

this works on the new master, however, there is another semi-related bug I'll submit a patch for