Skip to content

Commit d03da00

Browse files
author
Mike Terhar
authored
Add examples and behaviors to image tag docs (coder#238)
1 parent 91cc549 commit d03da00

File tree

3 files changed

+100
-1
lines changed

3 files changed

+100
-1
lines changed

guides/admin/image-tag-names.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
---
2+
title: "Image Tag Names"
3+
description: Learn about image tag naming conventions and recommendations for use.
4+
---
5+
6+
Coder uses image tags to determine the image variant to use when creating an
7+
environment.
8+
9+
Image tags are expressed using the following notation:
10+
11+
```text
12+
<image>:<image-tag>
13+
```
14+
15+
Examples include:
16+
17+
```text
18+
ubuntu:rolling
19+
ubuntu:latest
20+
ubuntu:20.04
21+
mycorp/myproject:v1
22+
```
23+
24+
This article will walk you through how Coder handles image tags and what to
25+
consider when working with image tags.
26+
27+
## Rebuilds use the same tag, not the same image
28+
29+
When modifying an existing image, be sure to consider whether the changes you're
30+
making will break existing environments built using that image. You may want to
31+
consider taking a semantic versioning view of your image tags for more critical
32+
images.
33+
34+
## Tag behavior
35+
36+
The following examples show how different tagging schemes change how Coder uses
37+
the image tag.
38+
39+
- If you build your environment using a `ubuntu:rolling` or `ubuntu:latest` tag,
40+
Coder prompts you to rebuild for patches, security updates, and major version
41+
releases. If you're supporting a SaaS product or working on mobile apps, you
42+
may opt for this to ensure that your tools stay up-to-date.
43+
44+
- If you build your environment using a specific version tag (e.g.,
45+
`ubuntu:20.04`), Coder will alert you regarding patches and security updates
46+
so that you rebuild your environment (you won't get these fixes otherwise).
47+
Coder does not, however, alert you regarding minor releases (e.g., movement
48+
from `20.04` to `20.10`). This is a good option for those offering long-term
49+
support of software with lengthier version cycles or those supporting multiple
50+
versions where you expect to revert to a prior release to investigate and fix
51+
issues.
52+
53+
- If you build your environment using `mycorp/myproject:v1`, the image is
54+
associated with a specific project's major version. You can apply the `:v1`
55+
tag to the most recent build for the image, while you can use `:v1.3` or
56+
`:v1.3.1` to pull a more specific tag version.
57+
58+
## Recommendations
59+
60+
- Use image names and tags that follow a consistent format across the
61+
organization so that users will be comfortable selecting either a _versioned_
62+
or a _rolling_ tag.
63+
64+
- To avoid pulling images from Docker Hub (or another external source), use
65+
internal registry names and tags or namespaces that are controlled by your
66+
organization.
67+
68+
## Sample tagging scheme
69+
70+
Let's say that you have the following tag:
71+
72+
```text
73+
registry:port/company/department/software:majorversion
74+
```
75+
76+
Here's the information that can be gleaned from the tag name:
77+
78+
- `registry:port`: By using an internal image registry name, there's no risk of
79+
pulling an outside image with unapproved content
80+
- `company`: If you're using an internal registry, you can omit this parameter
81+
- `department`: Helps set the scope for who owns the image and therefore can
82+
patch/modify the image
83+
- `software`: Offers information about which software systems should be
84+
developed using the image
85+
- `majorversion`: Can correlate to a software stock; helpful in determining
86+
which version of various dependencies and build tools are present in the image
87+
88+
The above recommendations are based on assumptions that may not apply to all
89+
organizations, and their applicability may change over time. There's no "right
90+
way" to tag your images, as long as your tags are meaningful to your teams and
91+
don't cause issues with your developers' workflows.

images/tags.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ target="_blank" rel="noreferrer noopener">Image tags</a> are variants of the
88
original (or base) image. Users can publish new image tags containing updated
99
dependencies and tooling useful for work on the project.
1010

11+
## Add a tag
12+
1113
To add a tag to Coder:
1214

1315
1. Go to **Images** and find the original image.
@@ -23,6 +25,9 @@ Each image has a default tag. The default tag appears at the top of the list and
2325
is indicated by an asterisk. Coder automatically selects the default tag when
2426
you create an environment.
2527

28+
> For information about how Coder handles image tags, see
29+
> [Image Tag Names](../guides/admin/image-tag-names.md).
30+
2631
### Changing the default tag
2732

2833
> We encourage you to update an image's default tag whenever you publish new
@@ -34,7 +39,7 @@ that image.
3439

3540
![Set default tag](../assets/default-tag.png)
3641

37-
To use an existing tag as the default tag, click the **vertical ellipses** for a
42+
To use an existing tag as the default tag, click the **vertical ellipsis** for a
3843
tag and select **Make default**.
3944

4045
![Set existing tag as default](../assets/existing-tag-as-default.png)

manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,9 @@
238238
"path": "./guides/admin/index.md",
239239
"navigable": false,
240240
"children": [
241+
{
242+
"path": "./guides/admin/image-tag-names.md"
243+
},
241244
{
242245
"path": "./guides/admin/resources.md"
243246
},

0 commit comments

Comments
 (0)