Browse Source

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 4 years ago
parent
commit
dbed7b51fc
3 changed files with 30 additions and 1 deletions
  1. 13 0
      .github/scripts/gen-docker-tags.py
  2. 1 1
      .github/workflows/docker.yml
  3. 16 0
      packaging/docker/README.md

+ 13 - 0
.github/scripts/gen-docker-tags.py

@@ -0,0 +1,13 @@
+#!/usr/bin/env python3
+
+import sys
+
+REPO = 'netdata/netdata'
+
+version = sys.argv[1].split('.')
+
+MAJOR = ':'.join([REPO, version[0]])
+MINOR = ':'.join([REPO, '.'.join(version[0:2])])
+PATCH = ':'.join([REPO, '.'.join(version[0:3])])
+
+print(','.join([MAJOR, MINOR, PATCH]))

+ 1 - 1
.github/workflows/docker.yml

@@ -30,7 +30,7 @@ jobs:
         if: github.event_name == 'workflow_dispatch' && github.event.inputs.version != 'nightly'
         run: |
           echo "publish=true" >> $GITHUB_ENV
-          echo "tags=netdata/netdata:latest,netdata/netdata:stable,netdata/netdata:${{ github.event.inputs.version }}" >> $GITHUB_ENV
+          echo "tags=netdata/netdata:latest,netdata/netdata:stable,$(.github/scripts/gen-docker-tags.py ${{ github.event.inputs.version }})" >> $GITHUB_ENV
       - name: Determine if we should push changes and which tags to use
         if: github.event_name == 'workflow_dispatch' && github.event.inputs.version == 'nightly'
         run: |

+ 16 - 0
packaging/docker/README.md

@@ -94,6 +94,22 @@ volumes:
   netdatacache:
 ```
 
+## Docker tags
+
+The official `netdata/netdata` Docker image provides the following named tags:
+
+* `stable`: The `stable` tag will always point to the most recently published stable build.
+* `edge`: The `edge` tag will always point ot the most recently published nightly build. In most cases, this is
+  updated daily at around 01:00 UTC.
+* `latest`: The `latest` tag will always point to the most recently published build, whether it’s a stable build
+  or a nightly build. This is what Docker will use by default if you do not specify a tag.
+
+Additionally, for each stable release, three tags are pushed, one with the full version of the release (for example,
+`v1.30.0`), one with just the major and minor version (for example, `v1.30`), and one with just the major version
+(for example, `v1`). The tags for the minor versions and major versions are updated whenever a release is published
+that would match that tag (for example, if `v1.30.1` were to be published, the `v1.30` tag would be updated to
+point to that instead of `v1.30.0`).
+
 ## Health Checks
 
 Our Docker image provides integrated support for health checks through the standard Docker interfaces.