@cryptotaxi247 / netdata-1 / commits / dbed7b51f

Changed Docker image tagging to use semver tags for releases. (#10648)

* Changed Docker image tagging to use semver tags for releases. This allows users to use image names like `netdata/netdata:1` or `netdata/netdata@1.29` and track the most up-to-date release that matches that version prefix. Such usage is a common practice for projects using semantic versioning like we are. This has a side effect, however, of remivng the `v` from the start of our version tags. Not having it is also more consistent with how a vast majority of other projects handle version tags, but users will need to be notified about the change. * Proper backwards compatability. * Add documentation about Docker image tags. * Update packaging/docker/README.md Co-authored-by: Joel Hans <joel.g.hans@gmail.com> Co-authored-by: Joel Hans <joel.g.hans@gmail.com>

Austin S. Hemmelgarn committed Mar 4, 2021 at 07:35 UTC dbed7b51fc2348246b64958d1c38902509731419
3 files changed +30 -1
.github/scripts/gen-docker-tags.py new
+13
@@ -0,0 +1,13 @@
1 +#!/usr/bin/env python3
2 +
3 +import sys
4 +
5 +REPO = 'netdata/netdata'
6 +
7 +version = sys.argv[1].split('.')
8 +
9 +MAJOR = ':'.join([REPO, version[0]])
10 +MINOR = ':'.join([REPO, '.'.join(version[0:2])])
11 +PATCH = ':'.join([REPO, '.'.join(version[0:3])])
12 +
13 +print(','.join([MAJOR, MINOR, PATCH]))
.github/workflows/docker.yml
+1 -1
@@ -30,7 +30,7 @@ jobs:
30 if: github.event_name == 'workflow_dispatch' && github.event.inputs.version != 'nightly'
31 run: |
32 echo "publish=true" >> $GITHUB_ENV
33 - echo "tags=netdata/netdata:latest,netdata/netdata:stable,netdata/netdata:${{ github.event.inputs.version }}" >> $GITHUB_ENV
33 + echo "tags=netdata/netdata:latest,netdata/netdata:stable,$(.github/scripts/gen-docker-tags.py ${{ github.event.inputs.version }})" >> $GITHUB_ENV
34 - name: Determine if we should push changes and which tags to use
35 if: github.event_name == 'workflow_dispatch' && github.event.inputs.version == 'nightly'
36 run: |
packaging/docker/README.md
+16
@@ -94,6 +94,22 @@ volumes:
94 netdatacache:
95 ```
96
97 +## Docker tags
98 +
99 +The official `netdata/netdata` Docker image provides the following named tags:
100 +
101 +* `stable`: The `stable` tag will always point to the most recently published stable build.
102 +* `edge`: The `edge` tag will always point ot the most recently published nightly build. In most cases, this is
103 + updated daily at around 01:00 UTC.
104 +* `latest`: The `latest` tag will always point to the most recently published build, whether it’s a stable build
105 + or a nightly build. This is what Docker will use by default if you do not specify a tag.
106 +
107 +Additionally, for each stable release, three tags are pushed, one with the full version of the release (for example,
108 +`v1.30.0`), one with just the major and minor version (for example, `v1.30`), and one with just the major version
109 +(for example, `v1`). The tags for the minor versions and major versions are updated whenever a release is published
110 +that would match that tag (for example, if `v1.30.1` were to be published, the `v1.30` tag would be updated to
111 +point to that instead of `v1.30.0`).
112 +
113 ## Health Checks
114
115 Our Docker image provides integrated support for health checks through the standard Docker interfaces.