From dbed7b51fc2348246b64958d1c38902509731419 Mon Sep 17 00:00:00 2001 From: "Austin S. Hemmelgarn" Date: Thu, 4 Mar 2021 07:35:05 -0500 Subject: 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 Co-authored-by: Joel Hans --- .github/scripts/gen-docker-tags.py | 13 +++++++++++++ .github/workflows/docker.yml | 2 +- packaging/docker/README.md | 16 ++++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100755 .github/scripts/gen-docker-tags.py diff --git a/.github/scripts/gen-docker-tags.py b/.github/scripts/gen-docker-tags.py new file mode 100755 index 0000000000..6c62511557 --- /dev/null +++ b/.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])) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 04f91bff55..5d5e8b0a7b 100644 --- a/.github/workflows/docker.yml +++ b/.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: | diff --git a/packaging/docker/README.md b/packaging/docker/README.md index e97cb0c6f3..a960897d8c 100644 --- a/packaging/docker/README.md +++ b/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. -- cgit v1.2.3