mirror of
https://github.com/coder/coder.git
synced 2026-09-21 20:51:01 +08:00
example: docker: support Windows hosts (#1880)
This commit is contained in:
@@ -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" {
|
||||
|
||||
@@ -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" {
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user