|
| 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. |
0 commit comments