2929 uses : actions/checkout@v2
3030 with :
3131 fetch-depth : 0
32+
33+ - name : Retrieve version
34+ run : echo "GIT_DESCRIBE=$(git describe --tags)" >> $GITHUB_ENV
3235
3336 - name : Get Docker tags for Alpine based image
3437 if : ${{ matrix.base == 'alpine' }}
4245 type=semver,pattern={{version}}
4346 type=semver,pattern={{major}}.{{minor}}
4447 type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }}
48+ labels : |
49+ org.opencontainers.image.version=${{ env.GIT_DESCRIBE }}
4550
4651 - name : Get Docker tags for Debian based image
4752 if : ${{ matrix.base == 'debian' }}
@@ -55,11 +60,10 @@ jobs:
5560 type=semver,suffix=-debian,pattern={{version}}
5661 type=semver,suffix=-debian,pattern={{major}}.{{minor}}
5762 type=raw,value=debian,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }}
63+ labels : |
64+ org.opencontainers.image.version=${{ env.GIT_DESCRIBE }}
5865 flavor : latest=false
5966
60- - name : Retrieve version
61- run : echo "VERSION=$(git describe --tags)" >> $GITHUB_ENV
62-
6367 - name : Set up QEMU
6468 uses : docker/setup-qemu-action@v1
6569
7781 id : docker_build_alpine
7882 uses : docker/build-push-action@v2
7983 with :
80- build-args : VERSION=${{ env.VERSION }}
84+ build-args : VERSION=${{ env.GIT_DESCRIBE }}
8185 platforms : linux/amd64,linux/arm64,linux/arm/v7
8286 push : true
8387 tags : ${{ steps.docker_meta_alpine.outputs.tags }}
8892 id : docker_build_debian
8993 uses : docker/build-push-action@v2
9094 with :
91- build-args : VERSION=${{ env.VERSION }}
95+ build-args : VERSION=${{ env.GIT_DESCRIBE }}
9296 file : Dockerfile.debian
9397 platforms : linux/amd64,linux/arm64,linux/arm/v7
9498 push : true
0 commit comments