Docker provider example

239 views
Skip to first unread message

Kodzo Wozufia

unread,
Jun 8, 2016, 11:04:18 AM6/8/16
to Terraform
Hi,


I'm looking for a full example about Docker provider. 


I think that the documentation lacks details.

Best regards

David Maze

unread,
Jun 8, 2016, 1:11:11 PM6/8/16
to Terraform
On Wednesday, June 8, 2016 at 11:04:18 AM UTC-4, Kodzo Wozufia wrote:
I'm looking for a full example about Docker provider. 

https://www.terraform.io/docs/providers/docker/index.html has a basic example.  It does involve understanding Docker concepts like "image" vs. "container".

I opined on another post on this forum that the Docker provider is probably the wrong tool.  Docker Compose, especially with its expanded v2 syntax, can do everything Terraform can; in my environment I use Terraform to provision EC2 instances and then use Ansible's Docker support to actually run containers.

What are you trying to do with Terraform and Docker more specifically? 

Kodzo Wozufia

unread,
Jun 9, 2016, 5:50:03 AM6/9/16
to Terraform
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... " 
Reply all
Reply to author
Forward
0 new messages