Closed georgevicbell closed 7 years ago
@georgevicbell @mitchellh Any idea when this will get released?, I'm running into this now with Docker/Chef Solo Provisioner
==> docker: Provisioning with chef-solo
docker: Installing Chef...
docker: % Total % Received % Xferd Average Speed Time Time Time Current
docker: Dload Upload Total Spent Left Speed
docker: 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0sudo: sorry, you must have a tty to run sudo
docker: 86 18736 86 16086 0 0 23986 0 --:--:-- --:--:-- --:--:-- 24008
docker: curl: (23) Failed writing body (0 != 16086)
==> docker: Killing the container: dc58f05be03632523cfd7a5abc462a82a0b2c43351b99ea0326444d4eb085ccf
Build 'docker' errored: Error installing Chef: Install script exited with non-zero exit status 1
==> Some builds didn't complete successfully and had errors:
--> docker: Error installing Chef: Install script exited with non-zero exit status 1
==> Builds finished but no artifacts were created.
Found a work around by Preventing sudo with chef provisioner.
It appears the docker communicator is not running exec or attach with -i -t (only the -i is passed).
There is no way to modify this behaviour.
docker/communicator.go: if c.canExec() { cmd = exec.Command("docker", "exec", "-i", c.ContainerId, "/bin/sh") } else { cmd = exec.Command("docker", "attach", c.ContainerId) }
There should be some config to allow for ptty to be turned on...