diff --git a/.docker/Dockerfile.alpine b/.docker/Dockerfile.alpine index a3f627f7..c2cd31f9 100644 --- a/.docker/Dockerfile.alpine +++ b/.docker/Dockerfile.alpine @@ -52,7 +52,7 @@ RUN apk add --no-cache --virtual buildtools build-base linux-headers udev python cp -R node_modules prod_node_modules #### Stage RELEASE ##################################################################################################### -FROM base AS RELEASE +FROM base AS release ARG BUILD_DATE ARG BUILD_VERSION ARG BUILD_REF @@ -71,6 +71,7 @@ LABEL org.label-schema.build-date=${BUILD_DATE} \ org.label-schema.vcs-ref=${BUILD_REF} \ org.label-schema.vcs-type="Git" \ org.label-schema.vcs-url="https://github.com/node-red/node-red-docker" \ + org.opencontainers.image.source="https://github.com/node-red/node-red-docker" \ org.label-schema.arch=${ARCH} \ authors="Dave Conway-Jones, Nick O'Leary, James Thomas, Raymond Mouthaan" diff --git a/.docker/Dockerfile.debian b/.docker/Dockerfile.debian index 48ae21e8..935bd636 100644 --- a/.docker/Dockerfile.debian +++ b/.docker/Dockerfile.debian @@ -19,7 +19,8 @@ RUN set -ex && \ git \ openssl \ openssh-client \ - ca-certificates && \ + ca-certificates \ + iputils-ping && \ mkdir -p /usr/src/node-red /data && \ deluser --remove-home node && \ # 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 && \ cp -R node_modules prod_node_modules #### Stage RELEASE ##################################################################################################### -FROM base AS RELEASE +FROM base AS release ARG BUILD_DATE ARG BUILD_VERSION ARG BUILD_REF @@ -70,6 +71,7 @@ LABEL org.label-schema.build-date=${BUILD_DATE} \ org.label-schema.vcs-ref=${BUILD_REF} \ org.label-schema.vcs-type="Git" \ org.label-schema.vcs-url="https://github.com/node-red/node-red-docker" \ + org.opencontainers.image.source="https://github.com/node-red/node-red-docker" \ org.label-schema.arch=${ARCH} \ authors="Dave Conway-Jones, Nick O'Leary, James Thomas, Raymond Mouthaan" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7ef7f716..4eea5251 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,10 +22,13 @@ jobs: # Setting the defaults up front LATEST_NODE: 20 DEFAULT_IMAGE: nodered/node-red + GH_IMAGE: ghcr.io/node-red/node-red DEV_IMAGE: nodered/node-red-dev + GH_DEV_IMAGE: ghcr.io/node-red/node-red-dev runs-on: ubuntu-latest strategy: + max-parallel: 2 matrix: node: [18, 20, 22] suffix: ["", "-minimal"] @@ -47,6 +50,7 @@ jobs: suffix=-${{matrix.node}}${{matrix.suffix}} images: | ${{ env.DEFAULT_IMAGE }} + ${{ env.GH_IMAGE }} tags: | type=ref,event=branch type=semver,pattern={{version}} @@ -54,9 +58,33 @@ jobs: - name: Setup QEMU uses: docker/setup-qemu-action@v3 + with: + platforms: arm64 + - + name: Set up SSH key pi5 + uses: MrSquaare/ssh-setup-action@2d028b70b5e397cf8314c6eaea229a6c3e34977a # v3.1.0 + with: + host: ${{ secrets.SSH_REMOTE_HOST}} + private-key: ${{ secrets.SSH_PRIVATE_KEY }} + private-key-name: remote + port: 2022 + - + name: Set up SSH key pi4 + uses: MrSquaare/ssh-setup-action@2d028b70b5e397cf8314c6eaea229a6c3e34977a # v3.1.0 + with: + host: ${{ secrets.SSH_REMOTE_HOST}} + private-key: ${{ secrets.SSH_PRIVATE_KEY }} + private-key-name: remote + port: 2023 - name: Setup Docker buildx uses: docker/setup-buildx-action@v3 + with: + append: | + - endpoint: ssh://nr@${{ secrets.SSH_REMOTE_HOST }}:2023 + platforms: linux/arm/v6,linux/arm/v7 + - endpoint: ssh://nr@${{ secrets.SSH_REMOTE_HOST }}:2022 + platforms: linux/arm64 - name: Get Date id: date # run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H:%M:%SZ')" @@ -83,7 +111,7 @@ jobs: TEMP=${TEMP:1} TEMP2=$(echo $GITHUB_REF | awk -F '/' '{ print $3}') echo "$GITHUB_REF - $TEMP" - TAGS=$(echo $TAGS | sed "s/$TEMP2/$TEMP/") + TAGS=$(echo $TAGS | sed "s/$TEMP2/$TEMP/g") TRAVIS_TAG=${{ github.event.inputs.version }} else TRAVIS_TAG=$(echo $GITHUB_REF | awk -F '/' '{ print $3}') @@ -93,20 +121,22 @@ jobs: if [[ "$TRAVIS_TAG" =~ ^v[0-9\.-]*$ ]]; then IMAGE=${{ env.DEFAULT_IMAGE }} + GH_IMAGE=${{ env.GH_IMAGE}} PUSH=true VERSION=${TRAVIS_TAG:1} STABLE_VERSION=`echo ${VERSION} | sed -r 's/^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)$/\1.\2/'` if [[ "${{ matrix.node }}" == "${{ env.LATEST_NODE }}" && "${{ matrix.suffix }}" == "" ]]; then - TAGS="$TAGS,$IMAGE:$VERSION,$IMAGE:$STABLE_VERSION,$IMAGE:latest" + TAGS="$TAGS,$IMAGE:$VERSION,$IMAGE:$STABLE_VERSION,$IMAGE:latest,$GH_IMAGE:$VERSION,$GH_IMAGE:$STABLE_VERSION,$GH_IMAGE:latest" elif [[ "${{ matrix.node }}" == "${{ env.LATEST_NODE }}" && "${{ matrix.suffix }}" == "-minimal" ]]; then - TAGS="$TAGS,$IMAGE:$VERSION-minimal,$IMAGE:latest-minimal" + TAGS="$TAGS,$IMAGE:$VERSION-minimal,$IMAGE:latest-minimal,$GH_IMAGE:$VERSION-minimal,$GH_IMAGE:latest-minimal" fi - TAGS="$TAGS,$IMAGE:latest-${{ matrix.node }}${{ matrix.suffix }}" + TAGS="$TAGS,$IMAGE:latest-${{ matrix.node }}${{ matrix.suffix }},$GH_IMAGE:latest-${{ matrix.node }}${{ matrix.suffix }}" else IMAGE=${{ env.DEV_IMAGE }} + GH_IMAGE=${{ env.GH_DEV_IMAGE}} if [[ "$TRAVIS_TAG" == *"dev"* || "$TRAVIS_TAG" == *"beta"* ]]; then PUSH=true else @@ -114,11 +144,25 @@ jobs: fi VERSION=${TRAVIS_TAG} TAGS=$(echo $TAGS | sed 's!${{ env.DEFAULT_IMAGE}}!${{ env.DEV_IMAGE }}!') + TAGS=$(echo $TAGS | sed 's!${{ env.GH_IMAGE}}!${{ env.GH_DEV_IMAGE }}!') if [ "${{ matrix.node }}" == "${{ env.LATEST_NODE }}" ] && [ "${{ matrix.suffix}}" == "" ]; then - TAGS="$TAGS,$IMAGE:$VERSION" + TAGS="$TAGS,$IMAGE:$VERSION,$GH_IMAGE:$VERSION" fi fi + # if [[ "${{ matrix.node }}" == "18"]]; then + # echo "platforms=linux/amd64,linux/arm/v7,linux/arm64" >> $GITHUB_OUTPUT + # else + # echo "platforms=linux/amd64,linux/arm64" >> $GITHUB_OUTPUT + # fi + + # if [[ "${{ matrix.suffix }}" == "-minimal" ]]; then + # echo "platforms=linux/amd64,linux/arm64" >> $GITHUB_OUTPUT + # else + # echo "platforms=linux/amd64,linux/arm/v7,linux/arm64" >> $GITHUB_OUTPUT + # fi + echo "platforms=linux/amd64,linux/arm/v7,linux/arm64" >> $GITHUB_OUTPUT + echo $TAGS echo "tags=$TAGS" >> $GITHUB_OUTPUT echo "push=$PUSH" >> $GITHUB_OUTPUT @@ -137,13 +181,20 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push id: build-push uses: docker/build-push-action@v5 with: context: . - platforms: linux/amd64, linux/arm64 + platforms: ${{ steps.nrVersion.outputs.platforms }} push: ${{ steps.nrVersion.outputs.push }} file: .docker/Dockerfile.alpine build-args: | @@ -161,7 +212,9 @@ jobs: # Setting the defaults up front LATEST_NODE: 20 DEFAULT_IMAGE: nodered/node-red + GH_IMAGE: ghcr.io/node-red/node-red DEV_IMAGE: nodered/node-red-dev + GH_DEV_IMAGE: ghcr.io/node-red/node-red-dev runs-on: ubuntu-latest steps: @@ -169,6 +222,8 @@ jobs: uses: actions/checkout@v4.1.2 - name: Setup QEMU uses: docker/setup-qemu-action@v3 + with: + image: tonistiigi/binfmt:qemu-v7.0.0-28 - name: Setup Docker buildx uses: docker/setup-buildx-action@v3 - name: Login to DockerHub @@ -176,6 +231,12 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Get Date id: date # run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H:%M:%SZ')" @@ -188,6 +249,7 @@ jobs: latest=false images: | ${{ env.DEFAULT_IMAGE }} + ${{ env.GH_IMAGE }} tags: | type=ref,event=branch type=semver,pattern={{version}} @@ -196,8 +258,15 @@ jobs: id: nrVersion run: | TAGS="" + while IFS= read -r TAG;do + if [ -z "$TAGS" ]; then + TAGS=$TAG + else + TAGS="$TAGS,$TAG" + fi + done <<< "${{ steps.meta.outputs.tags }}" - echo Original tags ${{ steps.meta.outputs.tags }} + echo "Original tags $TAGS" if [[ ! -z "${{ github.event.inputs.version }}" ]]; then TRAVIS_TAG=${{ github.event.inputs.version }} @@ -208,14 +277,16 @@ jobs: if [[ "$TRAVIS_TAG" =~ ^v[0-9\.-]*$ ]]; then # release build IMAGE=${{ env.DEFAULT_IMAGE }} + GH_IMAGE=${{ env.GH_IMAGE }} PUSH=true VERSION=${TRAVIS_TAG:1} STABLE_VERSION=`echo ${VERSION} | sed -r 's/^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)$/\1.\2/'` - TAGS="$IMAGE:latest-debian,$IMAGE:$VERSION-debian,$IMAGE:$STABLE_VERSION-debian" + TAGS="$IMAGE:latest-debian,$IMAGE:$VERSION-debian,$IMAGE:$STABLE_VERSION-debian,$GH_IMAGE:latest-debian,$GH_IMAGE:$VERSION-debian,$GH_IMAGE:$STABLE_VERSION-debian" else IMAGE=${{ env.DEV_IMAGE }} + GH_IMAGE=${{ env.GH_DEV_IMAGE}} if [[ "$TRAVIS_TAG" == *"dev"* || "$TRAVIS_TAG" == *"beta"* ]]; then # beta build PUSH=true @@ -224,7 +295,7 @@ jobs: fi VERSION=${TRAVIS_TAG} - TAGS="$IMAGE:$VERSION-debian" + TAGS="$IMAGE:$VERSION-debian,$GH_DEV_IMAGE:$VERSION" fi diff --git a/README.md b/README.md index 7c45d02f..83a56a69 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Let's dissect that command: -p 1880:1880 - connect local port 1880 to the exposed internal port 1880 -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 --name mynodered - give this machine a friendly local name - nodered/node-red - the image to base it on - currently Node-RED v4.0.0 + nodered/node-red - the image to base it on - currently Node-RED v4.0.9 @@ -35,7 +35,7 @@ Running that command should give a terminal window with a running instance of No Welcome to Node-RED =================== - 10 Oct 12:57:10 - [info] Node-RED version: v4.0.0 + 10 Oct 12:57:10 - [info] Node-RED version: v4.0.9 10 Oct 12:57:10 - [info] Node.js version: v18.19.0 10 Oct 12:57:10 - [info] Linux 6.6.13-100.fc38.x86_64 x64 LE 10 Oct 12:57:11 - [info] Loading palette nodes @@ -115,40 +115,40 @@ The following table shows the variety of provided Node-RED images. | **Tag** |**Node**| **Arch** | **Python** |**Dev**| **Base Image** | |----------------------------|--------|----------|------------|-------|----------------------------| -| 4.0.0-18 | 18 | amd64 | 3.x | yes | amd64/node:18-alpine | +| 4.0.9-18 | 18 | amd64 | 3.x | yes | amd64/node:18-alpine | | | 18 | arm32v7 | 3.x | yes | arm32v7/node:18-alpine | | | 18 | arm64v8 | 3.x | yes | arm64v8/node:18-alpine | | | 18 | i386 | 3.x | yes | i386/node:18-alpine | | | | | | | | -| 4.0.0-18-minimal | 18 | amd64 | no | no | amd64/node:18-alpine | +| 4.0.9-18-minimal | 18 | amd64 | no | no | amd64/node:18-alpine | | | 18 | arm32v7 | no | no | arm32v7/node:18-alpine | | | 18 | arm64v8 | no | no | arm64v8/node:18-alpine | | | 18 | i386 | no | no | i386/node:18-alpine | | **Tag** |**Node**| **Arch** | **Python** |**Dev**| **Base Image** | |----------------------------|--------|----------|------------|-------|----------------------------| -| 4.0.0-20 | 20 | amd64 | 3.x | yes | amd64/node:20-alpine | +| 4.0.9-20 | 20 | amd64 | 3.x | yes | amd64/node:20-alpine | | | 20 | arm32v7 | 3.x | yes | arm32v7/node:20-alpine | | | 20 | arm64v8 | 3.x | yes | arm64v8/node:20-alpine | | | 20 | i386 | 3.x | yes | i386/node:20-alpine | | | | | | | | -| 4.0.0-20-minimal | 20 | amd64 | no | no | amd64/node:20-alpine | +| 4.0.9-20-minimal | 20 | amd64 | no | no | amd64/node:20-alpine | | | 20 | arm32v7 | no | no | arm32v7/node:20-alpine | | | 20 | arm64v8 | no | no | arm64v8/node:20-alpine | | | 20 | i386 | no | no | i386/node:20-alpine | | | | | | | | -| 4.0.0-debian | 20 | amd64 | 3.x | yes | amd64/node:20-buster-slim | +| 4.0.9-debian | 20 | amd64 | 3.x | yes | amd64/node:20-buster-slim | | | 20 | arm32v7 | 3.x | yes | amd64/node:20-buster-slim | | | 20 | arm64v8 | 3.x | yes | amd64/node:20-buster-slim | | **Tag** |**Node**| **Arch** | **Python** |**Dev**| **Base Image** | |----------------------------|--------|----------|------------|-------|----------------------------| -| 4.0.0-22 | 22 | amd64 | 3.x | yes | amd64/node:22-alpine | +| 4.0.9-22 | 22 | amd64 | 3.x | yes | amd64/node:22-alpine | | | 22 | arm32v7 | 3.x | yes | arm32v7/node:22-alpine | | | 22 | arm64v8 | 3.x | yes | arm64v8/node:22-alpine | | | 22 | i386 | 3.x | yes | i386/node:22-alpine | | | | | | | | -| 4.0.0-22-minimal | 22 | amd64 | no | no | amd64/node:22-alpine | +| 4.0.9-22-minimal | 22 | amd64 | no | no | amd64/node:22-alpine | | | 22 | arm32v7 | no | no | arm32v7/node:22-alpine | | | 22 | arm64v8 | no | no | arm64v8/node:22-alpine | | | 22 | i386 | no | no | i386/node:22-alpine | @@ -160,28 +160,28 @@ The following table shows the provided Manifest Lists. | **Tag** | **Node-RED Base Image** | |----------------------------------------|--------------------------------------------| -| latest, 4.0.0, | nodered/node-red:4.0.0-20 | -| latest-20, 4.0.0-20 | | +| latest, 4.0.9, | nodered/node-red:4.0.9-20 | +| latest-20, 4.0.9-20 | | | | | | | | -| latest-minimal, 4.0.0-minimal, | nodered/node-red:4.0.0-20-minimal | -| latest-20-minimal, 4.0.0-20-minimal | | +| latest-minimal, 4.0.9-minimal, | nodered/node-red:4.0.9-20-minimal | +| latest-20-minimal, 4.0.9-20-minimal | | | | | | latest-debian | nodered/node-red:latest-debian | | **Tag** | **Node-RED Base Image** | |----------------------------------------|--------------------------------------------| -| latest-18, 4.0.0-18 | nodered/node-red:4.0.0-18 | +| latest-18, 4.0.9-18 | nodered/node-red:4.0.9-18 | | | | -| latest-18-minimal, 4.0.0-18-minimal | nodered/node-red:4.0.0-18-minimal | +| latest-18-minimal, 4.0.9-18-minimal | nodered/node-red:4.0.9-18-minimal | | **Tag** | **Node-RED Base Image** | |----------------------------------------|--------------------------------------------| -| latest-22, 4.0.0-22 | nodered/node-red:4.0.0-22 | +| latest-22, 4.0.9-22 | nodered/node-red:4.0.9-22 | | | | -| latest-22-minimal, 4.0.0-22-minimal | nodered/node-red:4.0.0-22-minimal +| latest-22-minimal, 4.0.9-22-minimal | nodered/node-red:4.0.9-22-minimal With the support of Docker manifest list, there is no need to explicitly add the tag for the architecture to use. @@ -189,7 +189,7 @@ When a docker run command or docker service command or docker stack command is e Therefore all tags regarding Raspberry PI's are dropped. -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. +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. ``` @@ -329,7 +329,7 @@ Docker build process, the dependencies are installed under `/usr/src/node-red`. The main sections to modify are "dependencies": { - "node-red": "^4.0.0", <-- set the version of Node-RED here + "node-red": "^4.0.9", <-- set the version of Node-RED here "node-red-dashboard": "*" <-- add any extra npm packages here }, diff --git a/docker-custom/Dockerfile.custom b/docker-custom/Dockerfile.custom index f412b73b..b1f99fff 100644 --- a/docker-custom/Dockerfile.custom +++ b/docker-custom/Dockerfile.custom @@ -52,7 +52,7 @@ RUN apk add --no-cache --virtual buildtools build-base linux-headers udev python cp -R node_modules prod_node_modules #### Stage RELEASE ##################################################################################################### -FROM base AS RELEASE +FROM base AS release ARG BUILD_DATE ARG BUILD_VERSION ARG BUILD_REF @@ -70,6 +70,7 @@ LABEL org.label-schema.build-date=${BUILD_DATE} \ org.label-schema.vcs-ref=${BUILD_REF} \ org.label-schema.vcs-type="Git" \ org.label-schema.vcs-url="https://github.com/node-red/node-red-docker" \ + org.opencontainers.image.source="https://github.com/node-red/node-red-docker" \ org.label-schema.arch=${ARCH} \ authors="Dave Conway-Jones, Nick O'Leary, James Thomas, Raymond Mouthaan" diff --git a/docker-custom/Dockerfile.debian b/docker-custom/Dockerfile.debian index 5f067aa5..57db5781 100644 --- a/docker-custom/Dockerfile.debian +++ b/docker-custom/Dockerfile.debian @@ -20,7 +20,8 @@ RUN set -ex && \ git \ openssl \ openssh-client \ - ca-certificates && \ + ca-certificates \ + iputils-ping && \ mkdir -p /usr/src/node-red /data && \ deluser --remove-home node && \ # adduser --home /usr/src/node-red --disabled-password --no-create-home node-red --uid 1000 && \ @@ -53,7 +54,7 @@ RUN apt-get update && apt-get install -y build-essential python && \ cp -R node_modules prod_node_modules #### Stage RELEASE ##################################################################################################### -FROM base AS RELEASE +FROM base AS release ARG BUILD_DATE ARG BUILD_VERSION ARG BUILD_REF @@ -71,6 +72,7 @@ LABEL org.label-schema.build-date=${BUILD_DATE} \ org.label-schema.vcs-ref=${BUILD_REF} \ org.label-schema.vcs-type="Git" \ org.label-schema.vcs-url="https://github.com/node-red/node-red-docker" \ + org.opencontainers.image.source="https://github.com/node-red/node-red-docker" \ org.label-schema.arch=${ARCH} \ authors="Dave Conway-Jones, Nick O'Leary, James Thomas, Raymond Mouthaan" diff --git a/docker-custom/package.json b/docker-custom/package.json index 25c57b6d..99878543 100644 --- a/docker-custom/package.json +++ b/docker-custom/package.json @@ -1,6 +1,6 @@ { "name": "node-red-docker", - "version": "4.0.0-beta.4", + "version": "4.0.9", "description": "Low-code programming for event-driven applications", "homepage": "http://nodered.org", "license": "Apache-2.0", @@ -29,7 +29,7 @@ } ], "dependencies": { - "node-red": "4.0.0-beta.4" + "node-red": "4.0.9" }, "engines": { "node": ">=18" diff --git a/package.json b/package.json index b0940ba3..c4a64aea 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-red-docker", - "version": "4.0.0-beta.4", + "version": "4.0.9", "description": "Low-code programming for event-driven applications", "homepage": "http://nodered.org", "license": "Apache-2.0", @@ -29,7 +29,7 @@ } ], "dependencies": { - "node-red": "4.0.0-beta.4" + "node-red": "4.0.9" }, "engines": { "node": ">=18"