Thank you for sharing your experience; I'll try your solutions.
When I try to create a container from a previously vm created (with Terraform via OpenStack), I get an error related to the opening of the port:
$ terraform plan
=> "Error pinging Docker server [...] connectex: no connection could be made because the target machine actively refused it".
When I open the port with the command "nc -kl <port>" on the VM, no error occurs but the command doesn't seem to execute.
$ terraform plan
=> "Refreshing Terraform state prior to plan... "