ci(docker): add OCI labels and build metadata to Docker images

Add comprehensive OCI Image Specification labels to Dockerfile including version, build date, and VCS reference. Update GitHub Actions workflows to pass build arguments for proper image metadata tracking.

- Add OCI labels for title, description, version, created date, revision, authors, vendor, licenses, and URLs
- Extract version from VERSION file in both develop and version workflows
- Pass APP_VERSION, BUILD_DATE, and VCS_REF as build arguments
This commit is contained in:
bobokun 2025-08-19 18:47:58 -04:00
parent 9e3575426b
commit 76f6579ce1
No known key found for this signature in database
GPG key ID: B73932169607D927
8 changed files with 128 additions and 72 deletions

View file

@ -376,6 +376,16 @@ jobs:
id: buildx id: buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
- name: Read version from VERSION file
id: get_version
run: echo "APP_VERSION=$(cat VERSION)" >> $GITHUB_OUTPUT
- name: Set build metadata
id: build_meta
run: |
echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
echo "VCS_REF=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: Build and push - name: Build and push
id: docker_build id: docker_build
uses: docker/build-push-action@v6 uses: docker/build-push-action@v6
@ -383,7 +393,10 @@ jobs:
context: ./ context: ./
file: ./Dockerfile file: ./Dockerfile
build-args: | build-args: |
"BRANCH_NAME=develop" BRANCH_NAME=develop
APP_VERSION=${{ steps.get_version.outputs.APP_VERSION }}
BUILD_DATE=${{ steps.build_meta.outputs.BUILD_DATE }}
VCS_REF=${{ steps.build_meta.outputs.VCS_REF }}
platforms: linux/amd64,linux/arm64,linux/arm/v7 platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true push: true
tags: | tags: |

View file

@ -400,12 +400,26 @@ jobs:
id: get_version id: get_version
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
- name: Read version from VERSION file
id: get_app_version
run: echo "APP_VERSION=$(cat VERSION)" >> $GITHUB_OUTPUT
- name: Set build metadata
id: build_meta
run: |
echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
echo "VCS_REF=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: Build and push - name: Build and push
id: docker_build id: docker_build
uses: docker/build-push-action@v6 uses: docker/build-push-action@v6
with: with:
context: ./ context: ./
file: ./Dockerfile file: ./Dockerfile
build-args: |
APP_VERSION=${{ steps.get_app_version.outputs.APP_VERSION }}
BUILD_DATE=${{ steps.build_meta.outputs.BUILD_DATE }}
VCS_REF=${{ steps.build_meta.outputs.VCS_REF }}
platforms: linux/amd64,linux/arm64,linux/arm/v7 platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true push: true
tags: | tags: |

View file

@ -5,6 +5,7 @@ repos:
hooks: hooks:
- id: trailing-whitespace - id: trailing-whitespace
- id: end-of-file-fixer - id: end-of-file-fixer
exclude: ^desktop/tauri/src-tauri/tauri\.conf\.json$
- id: check-merge-conflict - id: check-merge-conflict
- id: check-json - id: check-json
- id: check-yaml - id: check-yaml
@ -13,6 +14,7 @@ repos:
- id: fix-byte-order-marker - id: fix-byte-order-marker
- id: pretty-format-json - id: pretty-format-json
args: [--autofix, --indent, '4', --no-sort-keys] args: [--autofix, --indent, '4', --no-sort-keys]
exclude: ^desktop/tauri/src-tauri/tauri\.conf\.json$
- repo: https://github.com/adrienverge/yamllint.git - repo: https://github.com/adrienverge/yamllint.git
rev: v1.37.1 # or higher tag rev: v1.37.1 # or higher tag
hooks: hooks:
@ -41,3 +43,11 @@ repos:
language: script language: script
pass_filenames: false pass_filenames: false
stages: [pre-commit] stages: [pre-commit]
- id: cargo-check
name: Cargo check for Tauri desktop app
entry: bash -c "cd desktop/tauri/src-tauri && cargo check"
language: system
pass_filenames: false
files: ^desktop/tauri/src-tauri/.*\.(rs|toml|lock|json)$
stages: [pre-commit]
types_or: [rust, toml, json]

View file

@ -27,6 +27,25 @@ RUN /root/.local/bin/uv pip install --system .
# Final stage: minimal runtime image # Final stage: minimal runtime image
FROM python:3.13-alpine FROM python:3.13-alpine
# Build arguments
ARG APP_VERSION
ARG BUILD_DATE
ARG VCS_REF
# OCI Image Specification labels
LABEL org.opencontainers.image.title="qbit-manage"
LABEL org.opencontainers.image.description="This tool will help manage tedious tasks in qBittorrent and automate them. Tag, categorize, remove Orphaned data, remove unregistered torrents and much much more."
LABEL org.opencontainers.image.version="$APP_VERSION"
LABEL org.opencontainers.image.created="$BUILD_DATE"
LABEL org.opencontainers.image.revision="$VCS_REF"
LABEL org.opencontainers.image.authors="bobokun"
LABEL org.opencontainers.image.vendor="StuffAnThings"
LABEL org.opencontainers.image.licenses="MIT"
LABEL org.opencontainers.image.url="https://github.com/StuffAnThings/qbit_manage"
LABEL org.opencontainers.image.documentation="https://github.com/StuffAnThings/qbit_manage/wiki"
LABEL org.opencontainers.image.source="https://github.com/StuffAnThings/qbit_manage"
LABEL org.opencontainers.image.base.name="python:3.13-alpine"
ENV TINI_VERSION=v0.19.0 ENV TINI_VERSION=v0.19.0
# Runtime dependencies (smaller than build stage) # Runtime dependencies (smaller than build stage)

View file

@ -1 +1 @@
4.5.5-develop7 4.5.5-develop8

View file

@ -2917,7 +2917,7 @@ dependencies = [
[[package]] [[package]]
name = "qbit-manage-desktop" name = "qbit-manage-desktop"
version = "4.5.4-develop51" version = "4.5.5-develop8"
dependencies = [ dependencies = [
"libc", "libc",
"once_cell", "once_cell",

View file

@ -43,7 +43,7 @@ license = "MIT"
name = "qbit-manage-desktop" name = "qbit-manage-desktop"
repository = "" repository = ""
rust-version = "1.70" rust-version = "1.70"
version = "4.5.4-develop52" version = "4.5.5-develop8"
[target."cfg(unix)".dependencies] [target."cfg(unix)".dependencies]
libc = "0.2" libc = "0.2"

View file

@ -1,72 +1,72 @@
{ {
"app": { "app": {
"security": { "security": {
"csp": null "csp": null
},
"windows": [
{
"decorations": true,
"fullscreen": false,
"height": 800,
"label": "main",
"minHeight": 600,
"minWidth": 900,
"resizable": true,
"title": "qBit Manage",
"visible": false,
"width": 1100
}
],
"withGlobalTauri": true
}, },
"build": { "windows": [
"beforeBuildCommand": "", {
"beforeDevCommand": "", "decorations": true,
"devUrl": "http://localhost:8080", "fullscreen": false,
"frontendDist": "../src" "height": 800,
"label": "main",
"minHeight": 600,
"minWidth": 900,
"resizable": true,
"title": "qBit Manage",
"visible": false,
"width": 1100
}
],
"withGlobalTauri": true
},
"build": {
"beforeBuildCommand": "",
"beforeDevCommand": "",
"devUrl": "http://localhost:8080",
"frontendDist": "../src"
},
"bundle": {
"active": true,
"category": "Utility",
"icon": [
"../../../icons/qbm_logo.icns",
"../../../icons/qbm_logo.ico",
"../../../icons/qbm_logo.png"
],
"linux": {
"deb": {
"depends": [
"libgtk-3-0",
"libayatana-appindicator3-1",
"libwebkit2gtk-4.1-0"
]
}
}, },
"bundle": { "macOS": {
"active": true, "frameworks": [],
"category": "Utility", "minimumSystemVersion": "10.13"
"icon": [
"../../../icons/qbm_logo.icns",
"../../../icons/qbm_logo.ico",
"../../../icons/qbm_logo.png"
],
"linux": {
"deb": {
"depends": [
"libgtk-3-0",
"libayatana-appindicator3-1",
"libwebkit2gtk-4.1-0"
]
}
},
"macOS": {
"frameworks": [],
"minimumSystemVersion": "10.13"
},
"resources": [
"bin/*"
],
"targets": [
"deb",
"nsis",
"app",
"dmg"
],
"windows": {
"certificateThumbprint": null,
"digestAlgorithm": "sha256",
"nsis": {
"displayLanguageSelector": true,
"installMode": "currentUser",
"installerIcon": "../../../icons/qbm_logo.ico"
},
"timestampUrl": ""
}
}, },
"identifier": "com.qbitmanage.desktop", "resources": [
"productName": "qBit Manage", "bin/*"
"version": "4.5.4-develop52" ],
"targets": [
"deb",
"nsis",
"app",
"dmg"
],
"windows": {
"certificateThumbprint": null,
"digestAlgorithm": "sha256",
"nsis": {
"displayLanguageSelector": true,
"installMode": "currentUser",
"installerIcon": "../../../icons/qbm_logo.ico"
},
"timestampUrl": ""
}
},
"identifier": "com.qbitmanage.desktop",
"productName": "qBit Manage",
"version": "4.5.5-develop8"
} }