Open StoneMonarch opened 4 months ago
/*
The Problem:
resource "docker_volume" "tmp_volume" {
name = "tmp_volume"
driver_opts = {
"type" = "none"
"device" = "${path.cwd}/_bindfolder"
"o" = "bind"
}
} */
//Ugly Solution:
resource "null_resource" "set_volume_permissions" {
provisioner "local-exec" {
command = <<-EOT
docker volume create \
--name tmp_volume \
--opt type=none \
--opt device=${path.cwd}/_bindfolder \
--opt o=bind
EOT
}
}
Community Note
Description
Support for all possible options in the docker cli command
docker volume create
allowing for Cluster Volumes to be created.The current implementation only creates a volume on the node that terraform connects to, causing issues when the service and volume are on differant nodes.
The current workaround for this is to create each volume everytime it is needed in the
docker_service
resource.New or Affected Resource(s)
Potential Terraform Configuration
References