coder/examples/templates/docker-with-dotfiles
Geoffrey Huntley 26b54cd144
chore(autofix): upgrade-examples-terraform-provider-coder (#5498)
Automatically generated via https://github.com/coder/autofix
2022-12-23 12:25:56 +10:30
..
README.md chore: Add icons to templates (#5368) 2022-12-09 18:47:09 +00:00
main.tf chore(autofix): upgrade-examples-terraform-provider-coder (#5498) 2022-12-23 12:25:56 +10:30

README.md

name description tags icon
Develop in Docker with a dotfiles URL Run workspaces on a Docker host using registry images
local
docker
/icon/docker.png

docker-with-dotfiles

This is an example for deploying workspaces with a prompt for the users' dotfiles repo URI.

Getting started

Run coder templates init and select this template. Follow the instructions that appear.

How it works

During workspace creation, Coder prompts you to specify a dotfiles URL via a Terraform variable. Once the workspace starts, the Coder agent runs coder dotfiles via the startup script:

variable "dotfiles_uri" {
  description = <<-EOF
  Dotfiles repo URI (optional)

  see https://dotfiles.github.io
  EOF
    # The codercom/enterprise-* images are only built for amd64
  default = ""
}

resource "coder_agent" "main" {
  ...
  startup_script = var.dotfiles_uri != "" ? "/tmp/tmp.coder*/coder dotfiles -y ${var.dotfiles_uri}" : null
}

Managing images and workspaces

Refer to the documentation in the Docker template.