Skip to content

Commit a747cec

Browse files
committed
fixes from feedback
1 parent 6b2dbe9 commit a747cec

File tree

5 files changed

+22
-23
lines changed

5 files changed

+22
-23
lines changed

examples/docker-image-builds/README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@ Edit the validation to include the new image:
5454

5555
```diff
5656
variable "docker_image" {
57-
description = "What docker image would you like to use for your workspace?"
57+
description = "What Docker imagewould you like to use for your workspace?"
5858
default = "base"
5959

6060
# List of images available for the user to choose from.
6161
# Delete this condition to give users free text input.
6262
validation {
6363
- condition = contains(["base", "java", "node"], var.docker_image)
6464
+ condition = contains(["base", "java", "node", "golang], var.docker_image)
65-
error_message = "Invalid Docker Image!"
65+
error_message = "Invalid Docker image!"
6666
}
6767
}
6868
```
@@ -91,11 +91,11 @@ coder template update docker-image-builds
9191
```
9292

9393
You can also remove images from the validation list. Workspaces using older template versions will continue using
94-
the removed image until the workspace is updated to the latest version.
94+
the removed image until you update the workspace to the latest version.
9595

9696
## Updating images
9797

98-
Edit the Dockerfile (or related assets)
98+
Edit the Dockerfile (or related assets):
9999

100100
```sh
101101
vim images/node.Dockerfile
@@ -109,7 +109,7 @@ RUN DEBIAN_FRONTEND="noninteractive" apt-get update -y && \
109109
apt-get install -y nodejs
110110
```
111111

112-
1. Edit the template Terraform (`main.tf`)
112+
1. Edit the Terraform template (`main.tf`)
113113

114114
```sh
115115
vim main.tf
@@ -156,4 +156,4 @@ add the following features to your Coder template:
156156
- Custom container spec
157157
- More
158158

159-
Contributions are also welcome!
159+
We also welcome all contributions!

examples/docker-image-builds/images/java.Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ ENV MAVEN_HOME /usr/share/maven
1818
ENV MAVEN_CONFIG "/home/coder/.m2"
1919

2020
RUN mkdir -p $MAVEN_HOME $MAVEN_HOME/ref \
21-
&& echo "Downloading maven" \
21+
&& echo "Downloading Maven" \
2222
&& curl -fsSL -o /tmp/apache-maven.tar.gz https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz \
2323
\
2424
&& echo "Checking downloaded file hash" \
2525
&& echo "${MAVEN_SHA512} /tmp/apache-maven.tar.gz" | sha512sum -c - \
2626
\
27-
&& echo "Unzipping maven" \
27+
&& echo "Unzipping Maven" \
2828
&& tar -xzf /tmp/apache-maven.tar.gz -C $MAVEN_HOME --strip-components=1 \
2929
\
3030
&& echo "Cleaning and setting links" \
@@ -38,7 +38,7 @@ ARG GRADLE_SHA512=d495bc65379d2a854d2cca843bd2eeb94f381e5a7dcae89e6ceb6ef4c58355
3838
ENV GRADLE_HOME /usr/bin/gradle
3939

4040
RUN mkdir -p /usr/share/gradle /usr/share/gradle/ref \
41-
&& echo "Downloading gradle" \
41+
&& echo "Downloading Gradle" \
4242
&& curl -fsSL -o /tmp/gradle.zip https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip \
4343
\
4444
&& echo "Checking downloaded file hash" \

examples/docker-image-builds/main.tf

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ variable "step2_arch" {
3232
description = "arch: What archicture is your Docker host on?"
3333
validation {
3434
condition = contains(["amd64", "arm64", "armv7"], var.step2_arch)
35-
error_message = "Value must be amd64, arm64 or armv7."
35+
error_message = "Value must be amd64, arm64, or armv7."
3636
}
3737
sensitive = true
3838
}
@@ -54,20 +54,20 @@ resource "coder_agent" "dev" {
5454
}
5555

5656
variable "docker_image" {
57-
description = "What docker image would you like to use for your workspace?"
57+
description = "What Docker imagewould you like to use for your workspace?"
5858
default = "base"
5959

6060
# List of images available for the user to choose from.
6161
# Delete this condition to give users free text input.
6262
validation {
6363
condition = contains(["base", "java", "node"], var.docker_image)
64-
error_message = "Invalid Docker Image!"
64+
error_message = "Invalid Docker image!"
6565
}
6666

6767
# Prevents admin errors when the image is not found
6868
validation {
6969
condition = fileexists("images/${var.docker_image}.Dockerfile")
70-
error_message = "Invalid docker image. The file does not exist in the images directory."
70+
error_message = "Invalid Docker image. The file does not exist in the images directory."
7171
}
7272
}
7373

examples/docker/README.md

+8-9
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,25 @@ tags: [local, docker]
88

99
## Getting started
1010

11-
Pick this template in `coder templates init` and follow instructions.
11+
Run `coder templates init` and select this template. Follow the instructions that appear.
1212

1313
## Adding/removing images
1414

15-
After building and pushing an image to an image registry (e.g DockerHub), you can make the
16-
image available to users in the template.
15+
After building and pushing an image to an image registry (e.g., DockerHub), you can edit the template to make the image available to users.
1716

1817
Edit the template:
1918

2019
```sh
2120
vim main.tf
2221
```
2322
variable "docker_image" {
24-
description = "What docker image would you like to use for your workspace?"
23+
description = "What Docker imagewould you like to use for your workspace?"
2524
default = "codercom/enterprise-base:ubuntu"
2625
validation {
2726
- condition = contains(["codercom/enterprise-base:ubuntu", "codercom/enterprise-node:ubuntu", "codercom/enterprise-intellij:ubuntu"], var.docker_image)
2827
+ condition = contains(["codercom/enterprise-base:ubuntu", "codercom/enterprise-node:ubuntu", "codercom/enterprise-intellij:ubuntu", "codercom/enterprise-golang:ubuntu"], var.docker_image)
2928

30-
error_message = "Invalid Docker Image!"
29+
error_message = "Invalid Docker image!"
3130
}
3231
}
3332
```
@@ -38,16 +37,16 @@ Update the template:
3837
coder template update docker
3938
```
4039

41-
Images can also be removed from the validation list. Workspaces using older template versions will continue using
42-
the removed image until the workspace is updated to the latest version.
40+
You can also remove images from the validation list. Workspaces using older template versions will continue using
41+
the removed image until you update the workspace to the latest version.
4342

4443
## Updating images
4544

46-
To reduce drift, we recommend versioning images in your registry via tags. Update the image tag in the template:
45+
To reduce drift, we recommend versioning images in your registry by creating tags. To update the image tag in the template:
4746

4847
```sh
4948
variable "docker_image" {
50-
description = "What docker image would you like to use for your workspace?"
49+
description = "What Docker imagewould you like to use for your workspace?"
5150
default = "codercom/enterprise-base:ubuntu"
5251
validation {
5352
- condition = contains(["my-org/base-development:v1.1", "myorg-java-development:v1.1"], var.docker_image)

examples/docker/main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ variable "docker_image" {
6666
default = "codercom/enterprise-base:ubuntu"
6767
validation {
6868
condition = contains(["codercom/enterprise-base:ubuntu", "codercom/enterprise-node:ubuntu", "codercom/enterprise-intellij:ubuntu"], var.docker_image)
69-
error_message = "Invalid Docker Image!"
69+
error_message = "Invalid Docker image!"
7070
}
7171

7272
}

0 commit comments

Comments
 (0)