mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-11-07 04:42:54 -05:00
use 24.04 arm runners and node 22
Signed-off-by: Simon Smith <simonsmith5521@gmail.com>
This commit is contained in:
149
.github/workflows/docker.yml
vendored
149
.github/workflows/docker.yml
vendored
@@ -10,7 +10,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
translate:
|
translate:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-24.04
|
||||||
name: Run Translations
|
name: Run Translations
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
@@ -18,7 +18,7 @@ jobs:
|
|||||||
- name: Set up Node.js
|
- name: Set up Node.js
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: "lts/*"
|
node-version: "22.x"
|
||||||
- name: Run translate.js (ignore errors)
|
- name: Run translate.js (ignore errors)
|
||||||
run: node translate.js || true
|
run: node translate.js || true
|
||||||
working-directory: translate
|
working-directory: translate
|
||||||
@@ -38,11 +38,10 @@ jobs:
|
|||||||
path: .
|
path: .
|
||||||
|
|
||||||
build-amd64:
|
build-amd64:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-24.04
|
||||||
needs: translate
|
needs: translate
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
max-parallel: 3
|
|
||||||
matrix:
|
matrix:
|
||||||
variant: [mongodb, postgresql, mariadb, all, slim]
|
variant: [mongodb, postgresql, mariadb, all, slim]
|
||||||
name: Build Docker Image (amd64-${{ matrix.variant }})
|
name: Build Docker Image (amd64-${{ matrix.variant }})
|
||||||
@@ -96,11 +95,10 @@ jobs:
|
|||||||
.
|
.
|
||||||
|
|
||||||
build-arm64:
|
build-arm64:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04-arm
|
||||||
needs: translate
|
needs: translate
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
max-parallel: 3
|
|
||||||
matrix:
|
matrix:
|
||||||
variant: [mongodb, postgresql, mariadb, all, slim]
|
variant: [mongodb, postgresql, mariadb, all, slim]
|
||||||
name: Build Docker Image (arm64-${{ matrix.variant }})
|
name: Build Docker Image (arm64-${{ matrix.variant }})
|
||||||
@@ -118,7 +116,6 @@ jobs:
|
|||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
with:
|
with:
|
||||||
cache-binary: false
|
cache-binary: false
|
||||||
|
|
||||||
- name: Log in to GitHub Container Registry
|
- name: Log in to GitHub Container Registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
@@ -154,12 +151,128 @@ jobs:
|
|||||||
--push \
|
--push \
|
||||||
.
|
.
|
||||||
|
|
||||||
|
build-armv7:
|
||||||
|
runs-on: ubuntu-24.04-arm
|
||||||
|
needs: translate
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
variant: [mongodb, postgresql, mariadb, all, slim]
|
||||||
|
name: Build Docker Image (armv7-${{ 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: arm
|
||||||
|
- 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 (armv7-${{ 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="-armv7-mongodb";;
|
||||||
|
postgresql)
|
||||||
|
MONGODB=NO; POSTGRESQL=YES; MARIADB=NO; TAG="-armv7-postgresql";;
|
||||||
|
mariadb)
|
||||||
|
MONGODB=NO; POSTGRESQL=NO; MARIADB=YES; TAG="-armv7-mariadb";;
|
||||||
|
all)
|
||||||
|
MONGODB=YES; POSTGRESQL=YES; MARIADB=YES; TAG="-armv7";;
|
||||||
|
slim)
|
||||||
|
MONGODB=NO; POSTGRESQL=NO; MARIADB=NO; TAG="-armv7-slim";;
|
||||||
|
esac
|
||||||
|
docker buildx build \
|
||||||
|
--platform linux/arm/v7 \
|
||||||
|
--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 \
|
||||||
|
-t ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}$TAG \
|
||||||
|
--push \
|
||||||
|
.
|
||||||
|
|
||||||
|
build-armv6:
|
||||||
|
runs-on: ubuntu-24.04-arm
|
||||||
|
needs: translate
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
variant: [mongodb, postgresql, mariadb, all, slim]
|
||||||
|
name: Build Docker Image (armv6-${{ 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: arm
|
||||||
|
- 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 (armv6-${{ 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="-armv6-mongodb";;
|
||||||
|
postgresql)
|
||||||
|
MONGODB=NO; POSTGRESQL=YES; MARIADB=NO; TAG="-armv6-postgresql";;
|
||||||
|
mariadb)
|
||||||
|
MONGODB=NO; POSTGRESQL=NO; MARIADB=YES; TAG="-armv6-mariadb";;
|
||||||
|
all)
|
||||||
|
MONGODB=YES; POSTGRESQL=YES; MARIADB=YES; TAG="-armv6";;
|
||||||
|
slim)
|
||||||
|
MONGODB=NO; POSTGRESQL=NO; MARIADB=NO; TAG="-armv6-slim";;
|
||||||
|
esac
|
||||||
|
docker buildx build \
|
||||||
|
--platform linux/arm/v6 \
|
||||||
|
--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 \
|
||||||
|
-t ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}$TAG \
|
||||||
|
--push \
|
||||||
|
.
|
||||||
|
|
||||||
merge-manifest:
|
merge-manifest:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-24.03-arm
|
||||||
needs:
|
needs:
|
||||||
- translate
|
- translate
|
||||||
- build-amd64
|
- build-amd64
|
||||||
- build-arm64
|
- build-arm64
|
||||||
|
- build-armv7
|
||||||
|
- build-armv6
|
||||||
name: Create and Push Multi-Arch Manifest
|
name: Create and Push Multi-Arch Manifest
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
@@ -180,26 +293,36 @@ jobs:
|
|||||||
-t ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-mongodb \
|
-t ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-mongodb \
|
||||||
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-amd64-mongodb \
|
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-amd64-mongodb \
|
||||||
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-arm64-mongodb \
|
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-arm64-mongodb \
|
||||||
|
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-armv7-mongodb \
|
||||||
|
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-armv6-mongodb
|
||||||
# postgresql
|
# postgresql
|
||||||
docker buildx imagetools create \
|
docker buildx imagetools create \
|
||||||
-t ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-postgresql \
|
-t ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-postgresql \
|
||||||
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-amd64-postgresql \
|
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-amd64-postgresql \
|
||||||
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-arm64-postgresql \
|
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-arm64-postgresql \
|
||||||
|
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-armv7-postgresql \
|
||||||
|
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-armv6-postgresql
|
||||||
# mariadb
|
# mariadb
|
||||||
docker buildx imagetools create \
|
docker buildx imagetools create \
|
||||||
-t ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-mariadb \
|
-t ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-mariadb \
|
||||||
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-amd64-mariadb \
|
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-amd64-mariadb \
|
||||||
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-arm64-mariadb \
|
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-arm64-mariadb \
|
||||||
|
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-armv7-mariadb \
|
||||||
|
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-armv6-mariadb
|
||||||
# all (no suffix)
|
# all (no suffix)
|
||||||
docker buildx imagetools create \
|
docker buildx imagetools create \
|
||||||
-t ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }} \
|
-t ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }} \
|
||||||
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-amd64 \
|
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-amd64 \
|
||||||
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-arm64 \
|
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-arm64 \
|
||||||
|
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-armv7 \
|
||||||
|
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-armv6
|
||||||
# slim
|
# slim
|
||||||
docker buildx imagetools create \
|
docker buildx imagetools create \
|
||||||
-t ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-slim \
|
-t ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-slim \
|
||||||
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-amd64-slim \
|
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-amd64-slim \
|
||||||
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-arm64-slim \
|
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-arm64-slim \
|
||||||
|
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-armv7-slim \
|
||||||
|
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-armv6-slim
|
||||||
- name: Create and push 'latest' tags (releases only)
|
- name: Create and push 'latest' tags (releases only)
|
||||||
if: github.event_name == 'release'
|
if: github.event_name == 'release'
|
||||||
run: |
|
run: |
|
||||||
@@ -209,23 +332,33 @@ jobs:
|
|||||||
-t ghcr.io/$REPO_OWNER_LC/meshcentral:latest-mongodb \
|
-t ghcr.io/$REPO_OWNER_LC/meshcentral:latest-mongodb \
|
||||||
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-amd64-mongodb \
|
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-amd64-mongodb \
|
||||||
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-arm64-mongodb \
|
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-arm64-mongodb \
|
||||||
|
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-armv7-mongodb \
|
||||||
|
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-armv6-mongodb
|
||||||
# latest-postgresql
|
# latest-postgresql
|
||||||
docker buildx imagetools create \
|
docker buildx imagetools create \
|
||||||
-t ghcr.io/$REPO_OWNER_LC/meshcentral:latest-postgresql \
|
-t ghcr.io/$REPO_OWNER_LC/meshcentral:latest-postgresql \
|
||||||
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-amd64-postgresql \
|
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-amd64-postgresql \
|
||||||
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-arm64-postgresql \
|
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-arm64-postgresql \
|
||||||
|
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-armv7-postgresql \
|
||||||
|
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-armv6-postgresql
|
||||||
# latest-mariadb
|
# latest-mariadb
|
||||||
docker buildx imagetools create \
|
docker buildx imagetools create \
|
||||||
-t ghcr.io/$REPO_OWNER_LC/meshcentral:latest-mariadb \
|
-t ghcr.io/$REPO_OWNER_LC/meshcentral:latest-mariadb \
|
||||||
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-amd64-mariadb \
|
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-amd64-mariadb \
|
||||||
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-arm64-mariadb \
|
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-arm64-mariadb \
|
||||||
|
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-armv7-mariadb \
|
||||||
|
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-armv6-mariadb
|
||||||
# latest (all databases)
|
# latest (all databases)
|
||||||
docker buildx imagetools create \
|
docker buildx imagetools create \
|
||||||
-t ghcr.io/$REPO_OWNER_LC/meshcentral:latest \
|
-t ghcr.io/$REPO_OWNER_LC/meshcentral:latest \
|
||||||
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-amd64 \
|
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-amd64 \
|
||||||
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-arm64 \
|
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-arm64 \
|
||||||
|
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-armv7 \
|
||||||
|
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-armv6
|
||||||
# latest-slim
|
# latest-slim
|
||||||
docker buildx imagetools create \
|
docker buildx imagetools create \
|
||||||
-t ghcr.io/$REPO_OWNER_LC/meshcentral:latest-slim \
|
-t ghcr.io/$REPO_OWNER_LC/meshcentral:latest-slim \
|
||||||
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-amd64-slim \
|
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-amd64-slim \
|
||||||
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-arm64-slim \
|
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-arm64-slim \
|
||||||
|
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-armv7-slim \
|
||||||
|
ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-armv6-slim
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
### STAGE 1 BUILDING.
|
### STAGE 1 BUILDING.
|
||||||
FROM node:lts-alpine3.22 AS builder
|
FROM node:22-alpine3.22 AS builder
|
||||||
|
|
||||||
# Any value inside one of the disable ARGs will be accepted.
|
# Any value inside one of the disable ARGs will be accepted.
|
||||||
ARG DISABLE_EXTRACT="yes"
|
ARG DISABLE_EXTRACT="yes"
|
||||||
@@ -47,12 +47,12 @@ RUN rm -rf /opt/meshcentral/meshcentral/docker /opt/meshcentral/meshcentral/node
|
|||||||
|
|
||||||
### STAGE 2 PRECOMPILE DEPS MODULE
|
### STAGE 2 PRECOMPILE DEPS MODULE
|
||||||
|
|
||||||
FROM alpine:3.22 AS dep-compiler
|
FROM node:22-alpine3.22 AS dep-compiler
|
||||||
|
|
||||||
RUN apk update && \
|
RUN apk update && \
|
||||||
echo -e "----------\nINSTALLING ALPINE PACKAGES...\n----------"; \
|
echo -e "----------\nINSTALLING ALPINE PACKAGES...\n----------"; \
|
||||||
apk add --no-cache --update \
|
apk add --no-cache --update \
|
||||||
bash gcc g++ jq make nodejs npm python3 tzdata
|
bash gcc g++ jq make python3 tzdata
|
||||||
|
|
||||||
COPY --from=builder /opt/meshcentral/meshcentral /opt/meshcentral/meshcentral
|
COPY --from=builder /opt/meshcentral/meshcentral /opt/meshcentral/meshcentral
|
||||||
WORKDIR /opt/meshcentral/meshcentral
|
WORKDIR /opt/meshcentral/meshcentral
|
||||||
@@ -63,7 +63,7 @@ RUN jq '.dependencies += {"modern-syslog": "1.2.0", "telegram": "2.26.22"}' pack
|
|||||||
|
|
||||||
### STAGE 3 RUNTIME
|
### STAGE 3 RUNTIME
|
||||||
|
|
||||||
FROM alpine:3.22 AS runtime
|
FROM node:22-alpine3.22 AS runtime
|
||||||
|
|
||||||
# # Copy prepared app from builder stage
|
# # Copy prepared app from builder stage
|
||||||
COPY --from=dep-compiler /opt/meshcentral/meshcentral /opt/meshcentral/meshcentral
|
COPY --from=dep-compiler /opt/meshcentral/meshcentral /opt/meshcentral/meshcentral
|
||||||
|
|||||||
Reference in New Issue
Block a user