Skip to content

Commit 8534401

Browse files
authored
Merge pull request #481 from node-red/master
Sync Master to Dev
2 parents eb89667 + 7bacb4e commit 8534401

File tree

8 files changed

+115
-38
lines changed

8 files changed

+115
-38
lines changed

.docker/Dockerfile.alpine

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ RUN apk add --no-cache --virtual buildtools build-base linux-headers udev python
5252
cp -R node_modules prod_node_modules
5353

5454
#### Stage RELEASE #####################################################################################################
55-
FROM base AS RELEASE
55+
FROM base AS release
5656
ARG BUILD_DATE
5757
ARG BUILD_VERSION
5858
ARG BUILD_REF
@@ -71,6 +71,7 @@ LABEL org.label-schema.build-date=${BUILD_DATE} \
7171
org.label-schema.vcs-ref=${BUILD_REF} \
7272
org.label-schema.vcs-type="Git" \
7373
org.label-schema.vcs-url="https://github.com/node-red/node-red-docker" \
74+
org.opencontainers.image.source="https://github.com/node-red/node-red-docker" \
7475
org.label-schema.arch=${ARCH} \
7576
authors="Dave Conway-Jones, Nick O'Leary, James Thomas, Raymond Mouthaan"
7677

.docker/Dockerfile.debian

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ RUN set -ex && \
1919
git \
2020
openssl \
2121
openssh-client \
22-
ca-certificates && \
22+
ca-certificates \
23+
iputils-ping && \
2324
mkdir -p /usr/src/node-red /data && \
2425
deluser --remove-home node && \
2526
# adduser --home /usr/src/node-red --disabled-password --no-create-home node-red --uid 1000 && \
@@ -52,7 +53,7 @@ RUN apt-get update && apt-get install -y build-essential python && \
5253
cp -R node_modules prod_node_modules
5354

5455
#### Stage RELEASE #####################################################################################################
55-
FROM base AS RELEASE
56+
FROM base AS release
5657
ARG BUILD_DATE
5758
ARG BUILD_VERSION
5859
ARG BUILD_REF
@@ -70,6 +71,7 @@ LABEL org.label-schema.build-date=${BUILD_DATE} \
7071
org.label-schema.vcs-ref=${BUILD_REF} \
7172
org.label-schema.vcs-type="Git" \
7273
org.label-schema.vcs-url="https://github.com/node-red/node-red-docker" \
74+
org.opencontainers.image.source="https://github.com/node-red/node-red-docker" \
7375
org.label-schema.arch=${ARCH} \
7476
authors="Dave Conway-Jones, Nick O'Leary, James Thomas, Raymond Mouthaan"
7577

.github/workflows/main.yml

Lines changed: 80 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,13 @@ jobs:
2222
# Setting the defaults up front
2323
LATEST_NODE: 20
2424
DEFAULT_IMAGE: nodered/node-red
25+
GH_IMAGE: ghcr.io/node-red/node-red
2526
DEV_IMAGE: nodered/node-red-dev
27+
GH_DEV_IMAGE: ghcr.io/node-red/node-red-dev
2628
runs-on: ubuntu-latest
2729

2830
strategy:
31+
max-parallel: 2
2932
matrix:
3033
node: [18, 20, 22]
3134
suffix: ["", "-minimal"]
@@ -47,16 +50,41 @@ jobs:
4750
suffix=-${{matrix.node}}${{matrix.suffix}}
4851
images: |
4952
${{ env.DEFAULT_IMAGE }}
53+
${{ env.GH_IMAGE }}
5054
tags: |
5155
type=ref,event=branch
5256
type=semver,pattern={{version}}
5357
5458
-
5559
name: Setup QEMU
5660
uses: docker/setup-qemu-action@v3
61+
with:
62+
platforms: arm64
63+
-
64+
name: Set up SSH key pi5
65+
uses: MrSquaare/ssh-setup-action@2d028b70b5e397cf8314c6eaea229a6c3e34977a # v3.1.0
66+
with:
67+
host: ${{ secrets.SSH_REMOTE_HOST}}
68+
private-key: ${{ secrets.SSH_PRIVATE_KEY }}
69+
private-key-name: remote
70+
port: 2022
71+
-
72+
name: Set up SSH key pi4
73+
uses: MrSquaare/ssh-setup-action@2d028b70b5e397cf8314c6eaea229a6c3e34977a # v3.1.0
74+
with:
75+
host: ${{ secrets.SSH_REMOTE_HOST}}
76+
private-key: ${{ secrets.SSH_PRIVATE_KEY }}
77+
private-key-name: remote
78+
port: 2023
5779
-
5880
name: Setup Docker buildx
5981
uses: docker/setup-buildx-action@v3
82+
with:
83+
append: |
84+
- endpoint: ssh://nr@${{ secrets.SSH_REMOTE_HOST }}:2023
85+
platforms: linux/arm/v6,linux/arm/v7
86+
- endpoint: ssh://nr@${{ secrets.SSH_REMOTE_HOST }}:2022
87+
platforms: linux/arm64
6088
- name: Get Date
6189
id: date
6290
# run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H:%M:%SZ')"
@@ -83,7 +111,7 @@ jobs:
83111
TEMP=${TEMP:1}
84112
TEMP2=$(echo $GITHUB_REF | awk -F '/' '{ print $3}')
85113
echo "$GITHUB_REF - $TEMP"
86-
TAGS=$(echo $TAGS | sed "s/$TEMP2/$TEMP/")
114+
TAGS=$(echo $TAGS | sed "s/$TEMP2/$TEMP/g")
87115
TRAVIS_TAG=${{ github.event.inputs.version }}
88116
else
89117
TRAVIS_TAG=$(echo $GITHUB_REF | awk -F '/' '{ print $3}')
@@ -93,32 +121,48 @@ jobs:
93121
94122
if [[ "$TRAVIS_TAG" =~ ^v[0-9\.-]*$ ]]; then
95123
IMAGE=${{ env.DEFAULT_IMAGE }}
124+
GH_IMAGE=${{ env.GH_IMAGE}}
96125
PUSH=true
97126
VERSION=${TRAVIS_TAG:1}
98127
STABLE_VERSION=`echo ${VERSION} | sed -r 's/^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)$/\1.\2/'`
99128
100129
if [[ "${{ matrix.node }}" == "${{ env.LATEST_NODE }}" && "${{ matrix.suffix }}" == "" ]]; then
101-
TAGS="$TAGS,$IMAGE:$VERSION,$IMAGE:$STABLE_VERSION,$IMAGE:latest"
130+
TAGS="$TAGS,$IMAGE:$VERSION,$IMAGE:$STABLE_VERSION,$IMAGE:latest,$GH_IMAGE:$VERSION,$GH_IMAGE:$STABLE_VERSION,$GH_IMAGE:latest"
102131
elif [[ "${{ matrix.node }}" == "${{ env.LATEST_NODE }}" && "${{ matrix.suffix }}" == "-minimal" ]]; then
103-
TAGS="$TAGS,$IMAGE:$VERSION-minimal,$IMAGE:latest-minimal"
132+
TAGS="$TAGS,$IMAGE:$VERSION-minimal,$IMAGE:latest-minimal,$GH_IMAGE:$VERSION-minimal,$GH_IMAGE:latest-minimal"
104133
fi
105134
106-
TAGS="$TAGS,$IMAGE:latest-${{ matrix.node }}${{ matrix.suffix }}"
135+
TAGS="$TAGS,$IMAGE:latest-${{ matrix.node }}${{ matrix.suffix }},$GH_IMAGE:latest-${{ matrix.node }}${{ matrix.suffix }}"
107136
108137
else
109138
IMAGE=${{ env.DEV_IMAGE }}
139+
GH_IMAGE=${{ env.GH_DEV_IMAGE}}
110140
if [[ "$TRAVIS_TAG" == *"dev"* || "$TRAVIS_TAG" == *"beta"* ]]; then
111141
PUSH=true
112142
else
113143
PUSH=false
114144
fi
115145
VERSION=${TRAVIS_TAG}
116146
TAGS=$(echo $TAGS | sed 's!${{ env.DEFAULT_IMAGE}}!${{ env.DEV_IMAGE }}!')
147+
TAGS=$(echo $TAGS | sed 's!${{ env.GH_IMAGE}}!${{ env.GH_DEV_IMAGE }}!')
117148
if [ "${{ matrix.node }}" == "${{ env.LATEST_NODE }}" ] && [ "${{ matrix.suffix}}" == "" ]; then
118-
TAGS="$TAGS,$IMAGE:$VERSION"
149+
TAGS="$TAGS,$IMAGE:$VERSION,$GH_IMAGE:$VERSION"
119150
fi
120151
fi
121152
153+
# if [[ "${{ matrix.node }}" == "18"]]; then
154+
# echo "platforms=linux/amd64,linux/arm/v7,linux/arm64" >> $GITHUB_OUTPUT
155+
# else
156+
# echo "platforms=linux/amd64,linux/arm64" >> $GITHUB_OUTPUT
157+
# fi
158+
159+
# if [[ "${{ matrix.suffix }}" == "-minimal" ]]; then
160+
# echo "platforms=linux/amd64,linux/arm64" >> $GITHUB_OUTPUT
161+
# else
162+
# echo "platforms=linux/amd64,linux/arm/v7,linux/arm64" >> $GITHUB_OUTPUT
163+
# fi
164+
echo "platforms=linux/amd64,linux/arm/v7,linux/arm64" >> $GITHUB_OUTPUT
165+
122166
echo $TAGS
123167
echo "tags=$TAGS" >> $GITHUB_OUTPUT
124168
echo "push=$PUSH" >> $GITHUB_OUTPUT
@@ -137,13 +181,20 @@ jobs:
137181
with:
138182
username: ${{ secrets.DOCKERHUB_USERNAME }}
139183
password: ${{ secrets.DOCKERHUB_TOKEN }}
184+
-
185+
name: Login to GitHub Container Registry
186+
uses: docker/login-action@v3
187+
with:
188+
registry: ghcr.io
189+
username: ${{ github.repository_owner }}
190+
password: ${{ secrets.GITHUB_TOKEN }}
140191
-
141192
name: Build and push
142193
id: build-push
143194
uses: docker/build-push-action@v5
144195
with:
145196
context: .
146-
platforms: linux/amd64, linux/arm64
197+
platforms: ${{ steps.nrVersion.outputs.platforms }}
147198
push: ${{ steps.nrVersion.outputs.push }}
148199
file: .docker/Dockerfile.alpine
149200
build-args: |
@@ -161,21 +212,31 @@ jobs:
161212
# Setting the defaults up front
162213
LATEST_NODE: 20
163214
DEFAULT_IMAGE: nodered/node-red
215+
GH_IMAGE: ghcr.io/node-red/node-red
164216
DEV_IMAGE: nodered/node-red-dev
217+
GH_DEV_IMAGE: ghcr.io/node-red/node-red-dev
165218
runs-on: ubuntu-latest
166219

167220
steps:
168221
- name: Checkout
169222
uses: actions/[email protected]
170223
- name: Setup QEMU
171224
uses: docker/setup-qemu-action@v3
225+
with:
226+
image: tonistiigi/binfmt:qemu-v7.0.0-28
172227
- name: Setup Docker buildx
173228
uses: docker/setup-buildx-action@v3
174229
- name: Login to DockerHub
175230
uses: docker/login-action@v3
176231
with:
177232
username: ${{ secrets.DOCKERHUB_USERNAME }}
178233
password: ${{ secrets.DOCKERHUB_TOKEN }}
234+
- name: Login to GitHub Container Registry
235+
uses: docker/login-action@v3
236+
with:
237+
registry: ghcr.io
238+
username: ${{ github.repository_owner }}
239+
password: ${{ secrets.GITHUB_TOKEN }}
179240
- name: Get Date
180241
id: date
181242
# run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H:%M:%SZ')"
@@ -188,6 +249,7 @@ jobs:
188249
latest=false
189250
images: |
190251
${{ env.DEFAULT_IMAGE }}
252+
${{ env.GH_IMAGE }}
191253
tags: |
192254
type=ref,event=branch
193255
type=semver,pattern={{version}}
@@ -196,8 +258,15 @@ jobs:
196258
id: nrVersion
197259
run: |
198260
TAGS=""
261+
while IFS= read -r TAG;do
262+
if [ -z "$TAGS" ]; then
263+
TAGS=$TAG
264+
else
265+
TAGS="$TAGS,$TAG"
266+
fi
267+
done <<< "${{ steps.meta.outputs.tags }}"
199268
200-
echo Original tags ${{ steps.meta.outputs.tags }}
269+
echo "Original tags $TAGS"
201270
202271
if [[ ! -z "${{ github.event.inputs.version }}" ]]; then
203272
TRAVIS_TAG=${{ github.event.inputs.version }}
@@ -208,14 +277,16 @@ jobs:
208277
if [[ "$TRAVIS_TAG" =~ ^v[0-9\.-]*$ ]]; then
209278
# release build
210279
IMAGE=${{ env.DEFAULT_IMAGE }}
280+
GH_IMAGE=${{ env.GH_IMAGE }}
211281
PUSH=true
212282
VERSION=${TRAVIS_TAG:1}
213283
STABLE_VERSION=`echo ${VERSION} | sed -r 's/^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)$/\1.\2/'`
214284
215-
TAGS="$IMAGE:latest-debian,$IMAGE:$VERSION-debian,$IMAGE:$STABLE_VERSION-debian"
285+
TAGS="$IMAGE:latest-debian,$IMAGE:$VERSION-debian,$IMAGE:$STABLE_VERSION-debian,$GH_IMAGE:latest-debian,$GH_IMAGE:$VERSION-debian,$GH_IMAGE:$STABLE_VERSION-debian"
216286
217287
else
218288
IMAGE=${{ env.DEV_IMAGE }}
289+
GH_IMAGE=${{ env.GH_DEV_IMAGE}}
219290
if [[ "$TRAVIS_TAG" == *"dev"* || "$TRAVIS_TAG" == *"beta"* ]]; then
220291
# beta build
221292
PUSH=true
@@ -224,7 +295,7 @@ jobs:
224295
fi
225296
VERSION=${TRAVIS_TAG}
226297
227-
TAGS="$IMAGE:$VERSION-debian"
298+
TAGS="$IMAGE:$VERSION-debian,$GH_DEV_IMAGE:$VERSION"
228299
229300
fi
230301

README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Let's dissect that command:
2626
-p 1880:1880 - connect local port 1880 to the exposed internal port 1880
2727
-v node_red_data:/data - mount the host node_red_data directory to the container /data directory so any changes made to flows are persisted
2828
--name mynodered - give this machine a friendly local name
29-
nodered/node-red - the image to base it on - currently Node-RED v4.0.0
29+
nodered/node-red - the image to base it on - currently Node-RED v4.0.9
3030

3131

3232

@@ -35,7 +35,7 @@ Running that command should give a terminal window with a running instance of No
3535
Welcome to Node-RED
3636
===================
3737

38-
10 Oct 12:57:10 - [info] Node-RED version: v4.0.0
38+
10 Oct 12:57:10 - [info] Node-RED version: v4.0.9
3939
10 Oct 12:57:10 - [info] Node.js version: v18.19.0
4040
10 Oct 12:57:10 - [info] Linux 6.6.13-100.fc38.x86_64 x64 LE
4141
10 Oct 12:57:11 - [info] Loading palette nodes
@@ -115,40 +115,40 @@ The following table shows the variety of provided Node-RED images.
115115

116116
| **Tag** |**Node**| **Arch** | **Python** |**Dev**| **Base Image** |
117117
|----------------------------|--------|----------|------------|-------|----------------------------|
118-
| 4.0.0-18 | 18 | amd64 | 3.x | yes | amd64/node:18-alpine |
118+
| 4.0.9-18 | 18 | amd64 | 3.x | yes | amd64/node:18-alpine |
119119
| | 18 | arm32v7 | 3.x | yes | arm32v7/node:18-alpine |
120120
| | 18 | arm64v8 | 3.x | yes | arm64v8/node:18-alpine |
121121
| | 18 | i386 | 3.x | yes | i386/node:18-alpine |
122122
| | | | | | |
123-
| 4.0.0-18-minimal | 18 | amd64 | no | no | amd64/node:18-alpine |
123+
| 4.0.9-18-minimal | 18 | amd64 | no | no | amd64/node:18-alpine |
124124
| | 18 | arm32v7 | no | no | arm32v7/node:18-alpine |
125125
| | 18 | arm64v8 | no | no | arm64v8/node:18-alpine |
126126
| | 18 | i386 | no | no | i386/node:18-alpine |
127127

128128
| **Tag** |**Node**| **Arch** | **Python** |**Dev**| **Base Image** |
129129
|----------------------------|--------|----------|------------|-------|----------------------------|
130-
| 4.0.0-20 | 20 | amd64 | 3.x | yes | amd64/node:20-alpine |
130+
| 4.0.9-20 | 20 | amd64 | 3.x | yes | amd64/node:20-alpine |
131131
| | 20 | arm32v7 | 3.x | yes | arm32v7/node:20-alpine |
132132
| | 20 | arm64v8 | 3.x | yes | arm64v8/node:20-alpine |
133133
| | 20 | i386 | 3.x | yes | i386/node:20-alpine |
134134
| | | | | | |
135-
| 4.0.0-20-minimal | 20 | amd64 | no | no | amd64/node:20-alpine |
135+
| 4.0.9-20-minimal | 20 | amd64 | no | no | amd64/node:20-alpine |
136136
| | 20 | arm32v7 | no | no | arm32v7/node:20-alpine |
137137
| | 20 | arm64v8 | no | no | arm64v8/node:20-alpine |
138138
| | 20 | i386 | no | no | i386/node:20-alpine |
139139
| | | | | | |
140-
| 4.0.0-debian | 20 | amd64 | 3.x | yes | amd64/node:20-buster-slim |
140+
| 4.0.9-debian | 20 | amd64 | 3.x | yes | amd64/node:20-buster-slim |
141141
| | 20 | arm32v7 | 3.x | yes | amd64/node:20-buster-slim |
142142
| | 20 | arm64v8 | 3.x | yes | amd64/node:20-buster-slim |
143143

144144
| **Tag** |**Node**| **Arch** | **Python** |**Dev**| **Base Image** |
145145
|----------------------------|--------|----------|------------|-------|----------------------------|
146-
| 4.0.0-22 | 22 | amd64 | 3.x | yes | amd64/node:22-alpine |
146+
| 4.0.9-22 | 22 | amd64 | 3.x | yes | amd64/node:22-alpine |
147147
| | 22 | arm32v7 | 3.x | yes | arm32v7/node:22-alpine |
148148
| | 22 | arm64v8 | 3.x | yes | arm64v8/node:22-alpine |
149149
| | 22 | i386 | 3.x | yes | i386/node:22-alpine |
150150
| | | | | | |
151-
| 4.0.0-22-minimal | 22 | amd64 | no | no | amd64/node:22-alpine |
151+
| 4.0.9-22-minimal | 22 | amd64 | no | no | amd64/node:22-alpine |
152152
| | 22 | arm32v7 | no | no | arm32v7/node:22-alpine |
153153
| | 22 | arm64v8 | no | no | arm64v8/node:22-alpine |
154154
| | 22 | i386 | no | no | i386/node:22-alpine |
@@ -160,36 +160,36 @@ The following table shows the provided Manifest Lists.
160160

161161
| **Tag** | **Node-RED Base Image** |
162162
|----------------------------------------|--------------------------------------------|
163-
| latest, 4.0.0, | nodered/node-red:4.0.0-20 |
164-
| latest-20, 4.0.0-20 | |
163+
| latest, 4.0.9, | nodered/node-red:4.0.9-20 |
164+
| latest-20, 4.0.9-20 | |
165165
| | |
166166
| | |
167-
| latest-minimal, 4.0.0-minimal, | nodered/node-red:4.0.0-20-minimal |
168-
| latest-20-minimal, 4.0.0-20-minimal | |
167+
| latest-minimal, 4.0.9-minimal, | nodered/node-red:4.0.9-20-minimal |
168+
| latest-20-minimal, 4.0.9-20-minimal | |
169169
| | |
170170
| latest-debian | nodered/node-red:latest-debian |
171171

172172

173173
| **Tag** | **Node-RED Base Image** |
174174
|----------------------------------------|--------------------------------------------|
175-
| latest-18, 4.0.0-18 | nodered/node-red:4.0.0-18 |
175+
| latest-18, 4.0.9-18 | nodered/node-red:4.0.9-18 |
176176
| | |
177-
| latest-18-minimal, 4.0.0-18-minimal | nodered/node-red:4.0.0-18-minimal |
177+
| latest-18-minimal, 4.0.9-18-minimal | nodered/node-red:4.0.9-18-minimal |
178178

179179

180180
| **Tag** | **Node-RED Base Image** |
181181
|----------------------------------------|--------------------------------------------|
182-
| latest-22, 4.0.0-22 | nodered/node-red:4.0.0-22 |
182+
| latest-22, 4.0.9-22 | nodered/node-red:4.0.9-22 |
183183
| | |
184-
| latest-22-minimal, 4.0.0-22-minimal | nodered/node-red:4.0.0-22-minimal
184+
| latest-22-minimal, 4.0.9-22-minimal | nodered/node-red:4.0.9-22-minimal
185185

186186

187187
With the support of Docker manifest list, there is no need to explicitly add the tag for the architecture to use.
188188
When a docker run command or docker service command or docker stack command is executed, docker checks which architecture is required and verifies if it is available in the docker repository. If it does, docker pulls the matching image for it.
189189

190190
Therefore all tags regarding Raspberry PI's are dropped.
191191

192-
For example: suppose you are running on a Raspberry PI 3B, which has `arm32v7` as architecture. Then just run the following command to pull the image (tagged by `4.0.0-20`), and run the container.
192+
For example: suppose you are running on a Raspberry PI 3B, which has `arm32v7` as architecture. Then just run the following command to pull the image (tagged by `4.0.9-20`), and run the container.
193193

194194

195195
```
@@ -329,7 +329,7 @@ Docker build process, the dependencies are installed under `/usr/src/node-red`.
329329
The main sections to modify are
330330

331331
"dependencies": {
332-
"node-red": "^4.0.0", <-- set the version of Node-RED here
332+
"node-red": "^4.0.9", <-- set the version of Node-RED here
333333
"node-red-dashboard": "*" <-- add any extra npm packages here
334334
},
335335

0 commit comments

Comments
 (0)