Skip to content
This repository was archived by the owner on Aug 13, 2026. It is now read-only.

Commit 71b01d8

Browse files
Fix Docker Node Version Build Deps (#6548)
* fix: add NODE_VERSION build-arg and native build deps to fix Docker CI build * fix: add NODE_VERSION build-arg and native build deps to fix Docker CI build * fix: use native ARM runners and parallel matrix builds for Docker Hub CI * fix: update Docker Hub CI artifact pattern to include 'linux' in filename * Potential fix for pull request finding 'CodeQL / Workflow does not contain permissions' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --------- Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 571b5d6 commit 71b01d8

2 files changed

Lines changed: 107 additions & 29 deletions

File tree

‎.github/workflows/docker-image-dockerhub.yml‎

Lines changed: 100 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,64 @@ on:
99
required: true
1010
default: '24'
1111
options:
12+
- '20'
1213
- '24'
1314
tag_version:
1415
description: 'Tag version of the image to be pushed.'
1516
type: string
1617
required: true
1718
default: 'latest'
1819

20+
permissions:
21+
contents: read
22+
1923
jobs:
20-
docker:
24+
prepare:
2125
runs-on: ubuntu-latest
26+
outputs:
27+
node_version: ${{ steps.defaults.outputs.node_version }}
28+
tag_version: ${{ steps.defaults.outputs.tag_version }}
2229
steps:
2330
- name: Set default values
2431
id: defaults
2532
run: |
2633
echo "node_version=${{ github.event.inputs.node_version || '24' }}" >> $GITHUB_OUTPUT
2734
echo "tag_version=${{ github.event.inputs.tag_version || 'latest' }}" >> $GITHUB_OUTPUT
2835
36+
build:
37+
needs: prepare
38+
runs-on: ${{ matrix.runner }}
39+
strategy:
40+
fail-fast: false
41+
matrix:
42+
include:
43+
- image: flowiseai/flowise
44+
dockerfile: ./docker/Dockerfile
45+
platform: linux/amd64
46+
runner: ubuntu-latest
47+
- image: flowiseai/flowise
48+
dockerfile: ./docker/Dockerfile
49+
platform: linux/arm64
50+
runner: ubuntu-24.04-arm
51+
- image: flowiseai/flowise-worker
52+
dockerfile: docker/worker/Dockerfile
53+
platform: linux/amd64
54+
runner: ubuntu-latest
55+
- image: flowiseai/flowise-worker
56+
dockerfile: docker/worker/Dockerfile
57+
platform: linux/arm64
58+
runner: ubuntu-24.04-arm
59+
steps:
60+
- name: Prepare env
61+
run: |
62+
platform=${{ matrix.platform }}
63+
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
64+
image=${{ matrix.image }}
65+
echo "IMAGE_SLUG=${image//\//-}" >> $GITHUB_ENV
66+
2967
- name: Checkout
3068
uses: actions/checkout@v6.0.2
3169

32-
- name: Set up QEMU
33-
uses: docker/setup-qemu-action@v4.0.0
34-
3570
- name: Set up Docker Buildx
3671
uses: docker/setup-buildx-action@v4.0.0
3772

@@ -41,32 +76,69 @@ jobs:
4176
username: ${{ secrets.DOCKERHUB_USERNAME }}
4277
password: ${{ secrets.DOCKERHUB_TOKEN }}
4378

44-
# -------------------------
45-
# Build and push main image
46-
# -------------------------
47-
- name: Build and push main image
79+
- name: Build and push by digest
80+
id: build
4881
uses: docker/build-push-action@v6.19.2
4982
with:
5083
context: .
51-
file: ./docker/Dockerfile
84+
file: ${{ matrix.dockerfile }}
85+
platforms: ${{ matrix.platform }}
5286
build-args: |
53-
NODE_VERSION=${{ steps.defaults.outputs.node_version }}
54-
platforms: linux/amd64,linux/arm64
55-
push: true
56-
tags: |
57-
flowiseai/flowise:${{ steps.defaults.outputs.tag_version }}
58-
59-
# -------------------------
60-
# Build and push worker image
61-
# -------------------------
62-
- name: Build and push worker image
63-
uses: docker/build-push-action@v6.19.2
87+
NODE_VERSION=${{ needs.prepare.outputs.node_version }}
88+
outputs: type=image,name=${{ matrix.image }},push-by-digest=true,name-canonical=true,push=true
89+
90+
- name: Export digest
91+
run: |
92+
mkdir -p ${{ runner.temp }}/digests
93+
digest="${{ steps.build.outputs.digest }}"
94+
touch "${{ runner.temp }}/digests/${digest#sha256:}"
95+
96+
- name: Upload digest
97+
uses: actions/upload-artifact@v4
6498
with:
65-
context: .
66-
file: docker/worker/Dockerfile
67-
build-args: |
68-
NODE_VERSION=${{ steps.defaults.outputs.node_version }}
69-
platforms: linux/amd64,linux/arm64
70-
push: true
71-
tags: |
72-
flowiseai/flowise-worker:${{ steps.defaults.outputs.tag_version }}
99+
name: digests-${{ env.IMAGE_SLUG }}-${{ env.PLATFORM_PAIR }}
100+
path: ${{ runner.temp }}/digests/*
101+
if-no-files-found: error
102+
retention-days: 1
103+
104+
merge:
105+
needs: [prepare, build]
106+
runs-on: ubuntu-latest
107+
strategy:
108+
fail-fast: false
109+
matrix:
110+
image:
111+
- flowiseai/flowise
112+
- flowiseai/flowise-worker
113+
steps:
114+
- name: Prepare env
115+
run: |
116+
image=${{ matrix.image }}
117+
echo "IMAGE_SLUG=${image//\//-}" >> $GITHUB_ENV
118+
119+
- name: Download digests
120+
uses: actions/download-artifact@v4
121+
with:
122+
path: ${{ runner.temp }}/digests
123+
pattern: digests-${{ env.IMAGE_SLUG }}-linux-*
124+
merge-multiple: true
125+
126+
- name: Set up Docker Buildx
127+
uses: docker/setup-buildx-action@v4.0.0
128+
129+
- name: Login to Docker Hub
130+
uses: docker/login-action@v4
131+
with:
132+
username: ${{ secrets.DOCKERHUB_USERNAME }}
133+
password: ${{ secrets.DOCKERHUB_TOKEN }}
134+
135+
- name: Create manifest list and push
136+
working-directory: ${{ runner.temp }}/digests
137+
run: |
138+
docker buildx imagetools create \
139+
-t ${{ matrix.image }}:${{ needs.prepare.outputs.tag_version }} \
140+
$(printf '${{ matrix.image }}@sha256:%s ' *)
141+
142+
- name: Inspect image
143+
run: |
144+
docker buildx imagetools inspect ${{ matrix.image }}:${{ needs.prepare.outputs.tag_version }}

‎docker/Dockerfile‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1+
# Node.js version (overridable via build-arg from CI)
2+
ARG NODE_VERSION=24
3+
14
# Stage 1: Build stage
2-
FROM node:24-alpine AS build
5+
FROM node:${NODE_VERSION}-alpine AS build
36

47
USER root
58

9+
# Install build dependencies
10+
RUN apk add --no-cache git python3 py3-pip make g++ build-base cairo-dev pango-dev
11+
612
# Skip downloading Chrome for Puppeteer (saves build time)
713
ENV PUPPETEER_SKIP_DOWNLOAD=true
814

0 commit comments

Comments
 (0)