example: docker: support Windows hosts (#1880)

This commit is contained in:
Ben Potter
2022-05-28 01:09:29 +00:00
committed by GitHub
parent da7ed8b292
commit 7ad68ca36b
2 changed files with 25 additions and 4 deletions
+12 -1
View File
@@ -38,9 +38,20 @@ variable "step2_arch" {
}
sensitive = true
}
variable "step3_OS" {
description = <<-EOF
What operating system is your Coder host on?
EOF
validation {
condition = contains(["MacOS", "Windows", "Linux"], var.step3_OS)
error_message = "Value must be MacOS, Windows, or Linux."
}
sensitive = true
}
provider "docker" {
host = "unix:///var/run/docker.sock"
host = var.step3_OS == "Windows" ? "npipe:////.//pipe//docker_engine" : "unix:///var/run/docker.sock"
}
provider "coder" {
+13 -3
View File
@@ -17,8 +17,6 @@ terraform {
# host on the "docker" provider below.
variable "step1_docker_host_warning" {
description = <<-EOF
Is Docker running on the Coder host?
This template will use the Docker socket present on
the Coder host, which is not necessarily your local machine.
@@ -45,10 +43,22 @@ variable "step2_arch" {
}
sensitive = true
}
variable "step3_OS" {
description = <<-EOF
What operating system is your Coder host on?
EOF
validation {
condition = contains(["MacOS", "Windows", "Linux"], var.step3_OS)
error_message = "Value must be MacOS, Windows, or Linux."
}
sensitive = true
}
provider "docker" {
host = "unix:///var/run/docker.sock"
host = var.step3_OS == "Windows" ? "npipe:////.//pipe//docker_engine" : "unix:///var/run/docker.sock"
}
provider "coder" {
}