feat: add debian-based docker image (#7414)

Signed-off-by: Simon Smith <simonsmith5521@gmail.com>
Signed-off-by: si458 <simonsmith5521@gmail.com>
Co-authored-by: Daan Selen <dselen@systemec.nl>
Co-authored-by: Simon Smith <simonsmith5521@gmail.com>
Co-authored-by: TheDevRyan <175502913+The-Dev-Ryan@users.noreply.github.com>
This commit is contained in:
DaanSelen
2025-11-20 13:28:59 +01:00
committed by GitHub
parent 53f108fe7b
commit a8c3c8f977
10 changed files with 546 additions and 156 deletions

View File

@@ -1,9 +1,9 @@
name: Docker-Builder
name: Docker-Builder-Alpine
on:
workflow_dispatch:
schedule:
- cron: '2 0 * * *' # Daily at 00:02 UTC
- cron: '0 0 * * *' # Daily at 00:00 UTC
release:
types: [ published ]
@@ -95,7 +95,7 @@ jobs:
.
build-arm64:
runs-on: ubuntu-22.04-arm
runs-on: ubuntu-24.04-arm
needs: translate
strategy:
fail-fast: false

230
.github/workflows/docker-debian.yml vendored Normal file
View File

@@ -0,0 +1,230 @@
name: Docker-Builder-Debian
on:
workflow_dispatch:
schedule:
- cron: '0 1 * * *' # Daily at 01:00 UTC (I think)
release:
types: [ published ]
jobs:
translate:
runs-on: ubuntu-24.04
name: Run Translations
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: "lts/*"
- name: Run translate.js (ignore errors)
run: node translate.js || true
working-directory: translate
- name: Run translate extractall
run: node translate extractall
working-directory: translate
- name: Run translate.js minifyall
run: node translate.js minifyall
working-directory: translate
- name: Run translate.js translateall
run: node translate.js translateall
working-directory: translate
- name: Upload repo with translations
uses: actions/upload-artifact@v5
with:
name: repo-with-translations
path: .
build-amd64:
runs-on: ubuntu-24.04
needs: translate
strategy:
fail-fast: false
max-parallel: 3
matrix:
variant: [mongodb, postgresql, mariadb, all, slim]
name: Build Docker Image (amd64-${{ matrix.variant }})
steps:
- name: Download repo artifact
uses: actions/download-artifact@v5
with:
name: repo-with-translations
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
cache-image: false
platforms: amd64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
cache-binary: false
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.MY_TOKEN || secrets.GITHUB_TOKEN }}
- name: Build and push Docker image (amd64-${{ matrix.variant }})
run: |
REPO_OWNER_LC="$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')"
case "${{ matrix.variant }}" in
mongodb)
MONGODB=YES; POSTGRESQL=NO; MARIADB=NO; TAG="-amd64-mongodb-debian";;
postgresql)
MONGODB=NO; POSTGRESQL=YES; MARIADB=NO; TAG="-amd64-postgresql-debian";;
mariadb)
MONGODB=NO; POSTGRESQL=NO; MARIADB=YES; TAG="-amd64-mariadb-debian";;
all)
MONGODB=YES; POSTGRESQL=YES; MARIADB=YES; TAG="-amd64-debian";;
slim)
MONGODB=NO; POSTGRESQL=NO; MARIADB=NO; TAG="-amd64-slim-debian";;
esac
docker buildx build \
--platform linux/amd64 \
--build-arg INCLUDE_MONGODB_TOOLS=$MONGODB \
--build-arg INCLUDE_POSTGRESQL_TOOLS=$POSTGRESQL \
--build-arg INCLUDE_MARIADB_TOOLS=$MARIADB \
--build-arg DISABLE_MINIFY=yes \
--build-arg DISABLE_TRANSLATE=yes \
--build-arg DISABLE_EXTRACT=yes \
--build-arg PREINSTALL_LIBS=true \
-f docker/Dockerfile-debian \
-t ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}$TAG \
--push \
.
build-arm64:
runs-on: ubuntu-24.04-arm
needs: translate
strategy:
fail-fast: false
max-parallel: 3
matrix:
variant: [mongodb, postgresql, mariadb, all, slim]
name: Build Docker Image (arm64-${{ matrix.variant }})
steps:
- name: Download repo artifact
uses: actions/download-artifact@v5
with:
name: repo-with-translations
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
cache-image: false
platforms: arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
cache-binary: false
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.MY_TOKEN || secrets.GITHUB_TOKEN }}
- name: Build and push Docker image (arm64-${{ matrix.variant }})
run: |
REPO_OWNER_LC="$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')"
case "${{ matrix.variant }}" in
mongodb)
MONGODB=YES; POSTGRESQL=NO; MARIADB=NO; TAG="-arm64-mongodb-debian";;
postgresql)
MONGODB=NO; POSTGRESQL=YES; MARIADB=NO; TAG="-arm64-postgresql-debian";;
mariadb)
MONGODB=NO; POSTGRESQL=NO; MARIADB=YES; TAG="-arm64-mariadb-debian";;
all)
MONGODB=YES; POSTGRESQL=YES; MARIADB=YES; TAG="-arm64-debian";;
slim)
MONGODB=NO; POSTGRESQL=NO; MARIADB=NO; TAG="-arm64-slim-debian";;
esac
docker buildx build \
--platform linux/arm64 \
--build-arg INCLUDE_MONGODB_TOOLS=$MONGODB \
--build-arg INCLUDE_POSTGRESQL_TOOLS=$POSTGRESQL \
--build-arg INCLUDE_MARIADB_TOOLS=$MARIADB \
--build-arg DISABLE_MINIFY=yes \
--build-arg DISABLE_TRANSLATE=yes \
--build-arg DISABLE_EXTRACT=yes \
--build-arg PREINSTALL_LIBS=true \
-f docker/Dockerfile-debian \
-t ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}$TAG \
--push \
.
merge-manifest:
runs-on: ubuntu-24.04
needs:
- translate
- build-amd64
- build-arm64
name: Create and Push Multi-Arch Manifest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
cache-binary: false
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.MY_TOKEN || secrets.GITHUB_TOKEN }}
- name: Create and push multi-arch manifests for all variants
run: |
REPO_OWNER_LC="$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')"
# mongodb
docker buildx imagetools create \
-t ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-mongodb-debian \
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-amd64-mongodb-debian \
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-arm64-mongodb-debian \
# postgresql
docker buildx imagetools create \
-t ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-postgresql-debian \
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-amd64-postgresql-debian \
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-arm64-postgresql-debian \
# mariadb
docker buildx imagetools create \
-t ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-mariadb-debian \
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-amd64-mariadb-debian \
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-arm64-mariadb-debian \
# all (no suffix)
docker buildx imagetools create \
-t ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-debian \
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-amd64-debian \
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-arm64-debian \
# slim
docker buildx imagetools create \
-t ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-slim-debian \
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-amd64-slim-debian \
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-arm64-slim-debian \
- name: Create and push 'latest' tags (releases only)
if: github.event_name == 'release'
run: |
REPO_OWNER_LC="$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')"
# latest-mongodb
docker buildx imagetools create \
-t ghcr.io/$REPO_OWNER_LC/meshcentral:latest-mongodb-debian \
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-amd64-mongodb-debian \
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-arm64-mongodb-debian \
# latest-postgresql
docker buildx imagetools create \
-t ghcr.io/$REPO_OWNER_LC/meshcentral:latest-postgresql-debian \
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-amd64-postgresql-debian \
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-arm64-postgresql-debian \
# latest-mariadb
docker buildx imagetools create \
-t ghcr.io/$REPO_OWNER_LC/meshcentral:latest-mariadb-debian \
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-amd64-mariadb-debian \
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-arm64-mariadb-debian \
# latest (all databases)
docker buildx imagetools create \
-t ghcr.io/$REPO_OWNER_LC/meshcentral:latest-debian \
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-amd64-debian \
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-arm64-debian \
# latest-slim
docker buildx imagetools create \
-t ghcr.io/$REPO_OWNER_LC/meshcentral:latest-slim-debian \
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-amd64-slim-debian \
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-arm64-slim-debian \