Skip to content

coder templates create using the template docker-image-builds and derivatives fails to build #2815

Closed
@wale

Description

@wale

Problem

The images folder is seemingly not pushed to the host when running coder templates create on Windows clients. The second validation rule in the below template snippet seemingly always fails regardless of the availability of the relevant images folder:

variable "docker_image" {
  description = "What Docker image would you like to use for your workspace?"
  default     = "alpine"

  # List of images available for the user to choose from.
  # Delete this condition to give users free text input.
  validation {
    condition = contains([
      "alpine",
      "ubuntu"
    ], var.docker_image)
    error_message = "Invalid Docker image!"
  }

  # Prevents admin errors when the image is not found
  validation {
    condition     = fileexists("images/${var.docker_image}.Dockerfile")
    error_message = "Invalid Docker image. The file does not exist in the images directory."
  }
}

Logs:
Logs
Directory tree:
Tree

This is also reproducible with the default docker-image-builds template without any changes.

Coder version (on both host and client): Coder v0.7.6+a494489

Metadata

Metadata

Labels

s0Major regression, all-hands-on-deck to fix

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions