diff --git a/.gitea/workflows/build_docker.yaml b/.gitea/workflows/build_docker.yaml index ac76487..f3700c3 100644 --- a/.gitea/workflows/build_docker.yaml +++ b/.gitea/workflows/build_docker.yaml @@ -143,7 +143,10 @@ jobs: ls -al public/js/ - name: Record version and Delete Unnecessary files + id: prebuild run: | + echo "version=$(cat public/VERSION)" >> "$GITHUB_OUTPUT" + echo "revision=${GITHUB_SHA}" >> "$GITHUB_OUTPUT" echo ${GITHUB_SHA::8} > VERSION rm -rf .git* tests/ storage/app/test/ ls -al public/css/ @@ -156,6 +159,9 @@ jobs: file: docker/Dockerfile push: true tags: "${{ steps.registry.outputs.registry }}/${{ env.GITHUB_REPOSITORY }}:${{ env.VERSIONARCH }}" + build-args: | + BUILD_REVISION=${{ steps.prebuild.outputs.revision }} + BUILD_VERSION=${{ steps.prebuild.outputs.version }} manifest: name: Final Docker Image Manifest diff --git a/docker/Dockerfile b/docker/Dockerfile index 27f4eac..2346692 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,5 +1,17 @@ FROM dunglas/frankenphp:php8.4-alpine +ARG BUILD_VERSION=2.0.0-dev +ARG BUILD_REVISION=00000000 + +LABEL org.opencontainers.image.vendor="Deon George" +LABEL org.opencontainers.image.licenses=GPLv2 +LABEL org.opencontainers.image.source=https://github.com/leenooks/phpldapadmin +LABEL org.opencontainers.image.title=phpLDAPadmin +LABEL org.opencontainers.image.description="An LDAP Administration Tool" +LABEL org.opencontainers.image.url=https://phpldapadmin.org +LABEL org.opencontainers.image.version=${BUILD_VERSION} +LABEL org.opencontainers.image.revision=${BUILD_REVISION} + # Base RUN apk add --no-cache bash