summary refs log tree commit diff
diff options
context:
space:
mode:
authorMo Balaa <thebalaa@users.noreply.github.com>2023-07-26 11:16:12 -0500
committerGitHub <noreply@github.com>2023-07-26 16:16:12 +0000
commit96529c42368a6153a92330c3f03be5b02ce4653c (patch)
tree844100d66ed68a5e10aff9d25f36cc930f9fff38
parentMerge branch 'release-v1.89' into develop (diff)
downloadsynapse-96529c42368a6153a92330c3f03be5b02ce4653c.tar.xz
Add synapse version as Docker container label (#15972)
Co-authored-by: Mo Balaa <balaa@fractalnetworks.co>
-rw-r--r--.github/workflows/docker.yml8
-rw-r--r--changelog.d/15972.docker1
2 files changed, 8 insertions, 1 deletions
diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml
index 602f5e1759..cf98a6a86f 100644
--- a/.github/workflows/docker.yml
+++ b/.github/workflows/docker.yml
@@ -28,6 +28,10 @@ jobs:
 
       - name: Inspect builder
         run: docker buildx inspect
+      
+      - name: Extract version from pyproject.toml
+        run: |
+          echo "SYNAPSE_VERSION=$(grep "^version" pyproject.toml | sed -E 's/version\s*=\s*["]([^"]*)["]/\1/')" >> $GITHUB_ENV
 
       - name: Log in to DockerHub
         uses: docker/login-action@v2
@@ -61,7 +65,9 @@ jobs:
         uses: docker/build-push-action@v4
         with:
           push: true
-          labels: "gitsha1=${{ github.sha }}"
+          labels: |
+            gitsha1=${{ github.sha }}
+            org.opencontainers.image.version=${{ env.SYNAPSE_VERSION }}
           tags: "${{ steps.set-tag.outputs.tags }}"
           file: "docker/Dockerfile"
           platforms: linux/amd64,linux/arm64
diff --git a/changelog.d/15972.docker b/changelog.d/15972.docker
new file mode 100644
index 0000000000..7fd9707deb
--- /dev/null
+++ b/changelog.d/15972.docker
@@ -0,0 +1 @@
+Add `org.opencontainers.image.version` labels to Docker containers [published by Matrix.org](https://hub.docker.com/r/matrixdotorg/synapse). Contributed by Mo Balaa.