A common way to create a template is to begin with a starter template then modify it for your needs. Coder makes this easy with starter templates for popular development targets like Docker, Kubernetes, Azure, and so on. Once your template is up and running, you can edit it in the Coder dashboard. Coder even handles versioning for you so you can publish official updates or revert to previous versions.
In this tutorial, you'll create your first template from the Docker starter template.
When setting up your computer or computing instance, make sure to install Docker first, then Coder.
In your web browser, go to your Coder dashboard to log in.
Select Templates > Starter Templates.
In Filter, select Docker then select Develop in Docker.
Select Use template.
In Create template, fill in Name and Display name,then scroll down and select Create template.
When the template is ready, select Create Workspace.
In New workspace, fill in Name then scroll down to select Create Workspace.
Coder starts your new workspace from your template.
After a few seconds, your workspace is ready to use.
This starter template lets you connect to your workspace in a few ways:
- VS Code Desktop: Loads your workspace into VS Code Desktop installed on your local computer.
- code-server: Opens browser-based VS Code with your workspace.
- Terminal: Opens a browser-based terminal with a shell in the workspace's Docker instance.
- SSH: Use SSH to log in to the workspace from your local machine. If you haven't already, you'll have to install Coder on your local machine to configure your SSH client.
Tip: You can edit the template to let developers connect to a workspace in a few more ways.
When you're done, you can stop the workspace.
Now you can modify your template to suit your team's needs.
Let's replace the
golang package in the Docker image with the
package. You can do this by editing the template's
Dockerfile directly in your
In the Coder dashboard, select Templates then your first template.
In the drop-down menu, select Edit files.
Expand the build directory and select Dockerfile.
build/Dockerfile to replace
Select Build template and wait for Coder to prepare the template for workspaces.
Select Publish version. In the Publish new version dialog, make sure Promote to default version is checked then select Publish.
Now when developers create a new workspace from this template, they can use Python 3 instead of Go.
For developers with workspaces that were created with a previous version of your template, Coder will notify them that there's a new version of the template.
You can also handle change management through your own repo and continuous integration.