Skip to content

Commit

Permalink
combine functions for easier maintenance.
Browse files Browse the repository at this point in the history
  • Loading branch information
RaymondMouthaan committed Aug 23, 2019
1 parent 802bed7 commit 42bfc86
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 69 deletions.
14 changes: 7 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ env:
matrix:
### Node JS 12 ####################################################################################################
# No Python Images
- DOCKER_FILE=Dockerfile.alpine NODE_VERSION=12 OS=alpine QEMU_ARCH=x86_64 ARCH=amd64 PYTHON_VERSION=0
- DOCKER_FILE=Dockerfile.alpine NODE_VERSION=12 OS=alpine QEMU_ARCH=arm ARCH=arm32v6 PYTHON_VERSION=0
- DOCKER_FILE=Dockerfile.alpine NODE_VERSION=12 OS=alpine QEMU_ARCH=arm ARCH=arm32v7 PYTHON_VERSION=0
- DOCKER_FILE=Dockerfile.alpine NODE_VERSION=12 OS=alpine QEMU_ARCH=aarch64 ARCH=arm64v8 PYTHON_VERSION=0
- DOCKER_FILE=Dockerfile.alpine NODE_VERSION=12 NODE_RED_VERSION=$ OS=alpine QEMU_ARCH=x86_64 ARCH=amd64 PYTHON_VERSION=0
- DOCKER_FILE=Dockerfile.alpine NODE_VERSION=12 NODE_RED_VERSION=12 OS=alpine QEMU_ARCH=arm ARCH=arm32v6 PYTHON_VERSION=0
- DOCKER_FILE=Dockerfile.alpine NODE_VERSION=12 NODE_RED_VERSION=12 OS=alpine QEMU_ARCH=arm ARCH=arm32v7 PYTHON_VERSION=0
- DOCKER_FILE=Dockerfile.alpine NODE_VERSION=12 NODE_RED_VERSION=12 OS=alpine QEMU_ARCH=aarch64 ARCH=arm64v8 PYTHON_VERSION=0

# Python 2 Images
- DOCKER_FILE=Dockerfile.alpine NODE_VERSION=12 OS=alpine QEMU_ARCH=x86_64 ARCH=amd64 PYTHON_VERSION=2
Expand Down Expand Up @@ -59,10 +59,10 @@ before_script:
# Set BUILD_VERSION
- if [ ! -z "${TRAVIS_TAG}" ]; then export BUILD_VERSION=${TRAVIS_TAG:1}; else export BUILD_VERSION=beta; fi

script:
# Update NODE_RED_VERSION from package.json
- ./.docker/update_version.sh
# Update NODE_RED_VERSION from package.json
- ./.docker/update_version.sh

script:
# Build Docker image
- ./.docker/docker.sh build

Expand Down
138 changes: 76 additions & 62 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,85 +81,99 @@ extra nodes you install "outside" of the container. We do this so that you may r
container without permanently losing all of your customisations._

## Image Variations
The Node-RED images have different variations and are supported by manifest lists (auto-detect architecture).
The Node-RED images come in different variations and are supported by manifest lists (auto-detect architecture).
This makes it more easy to deploy in a multi architecture Docker environment. E.g. a Docker Swarm with mix of Raspberry Pi's and amd64 nodes.

The tag naming convention is `<node-red-version>-<os>-<architecture>`, where:
The tag naming convention is `<node-red-version>-<node>-<os>-<architecture>`, where:
- `<node-red-version>` is the Node-RED version.
- `<os>` is either Alpine or Debian slim based.
- `<node>` is the Node JS version.
- `<os>` is Alpine based.
- `<architecture>` is the architecture of the Docker host system, either amd64, arm32v6, arm32v7, arm64.

The Node-RED images are based on the [official Node JS v10](https://hub.docker.com/_/node/), which are based on Alpine Linux or Debian Linux (slim)
and are kept as small as possible (no build tools pre-installed).
Using Alpine Linux or Debian Linux (slim) reduces the built image size (~100MB vs ~700MB), but removes
standard dependencies that are required for native module compilation. If you want to add dependencies with native dependencies, extend the Node-RED image with the missing packages on running containers or build new images.

The following table shows the variation of provided images.

|**Tag** |**Base Image** |**Arch** |**OS** |**Python**|**GPIO**|
|------------------------------------|-----------------------------|------------|-----------|----------|--------|
| 0.20.7-alpine-amd64 | amd64/node:10-alpine | amd64 | alpine | no | no |
| 0.20.7-alpine-arm32v6 | arm32v6/node:10-alpine | arm32v6 | alpine | no | no |
| ~~0.20.7-alpine-arm32v7~~ | ~~arm32v7/node:10-alpine~~ | ~~arm32v7~~| ~~alpine~~| no | no |
| 0.20.7-buster-slim-arm32v7 | arm32v7/node:10-buster-slim | arm32v7 | debian | no | no |
| 0.20.7-alpine-arm64v8 | arm64v8/node:10-alpine | arm64v8 | alpine | no | no |
||
| 0.20.7-alpine-amd64-python3 | amd64/node:10-alpine | amd64 | alpine | 3.x | no |
| 0.20.7-alpine-arm32v6-python3 | arm32v6/node:10-alpine | arm32v6 | alpine | 3.x | yes |
| ~~0.20.7-alpine-arm32v7-python3~~ | ~~arm32v7/node:10-alpine~~ | ~~arm32v7~~| ~~alpine~~| 3.x | yes |
| 0.20.7-buster-slim-arm32v7-python3 | arm32v7/node:10-slim | arm32v7 | debian | 3.x | yes |
| 0.20.7-alpine-arm64v8-python3 | arm64v8/node:10-alpine | arm64v8 | alpine | 3.x | no |
||
| 0.20.7-alpine-amd64-python2 | amd64/node:10-alpine | amd64 | alpine | 2.x | no |
| 0.20.7-alpine-arm32v6-python2 | arm32v6/node:10-alpine | arm32v6 | alpine | 2.x | yes |
| ~~0.20.7-alpine-arm32v7-python2~~ | ~~arm32v7/node:10-alpine~~ | ~~arm32v7~~| ~~alpine~~| 2.x | yes |
| 0.20.7-buster-slim-arm32v7-python2 | arm32v7/node:10-slim | arm32v7 | debian | 2.x | yes |
| 0.20.7-alpine-arm64v8-python2 | arm64v8/node:10-alpine | arm64v8 | alpine | 2.x | no |
The Node-RED images are based on the [official Node JS v10](https://hub.docker.com/_/node/), which are based on Alpine Linux and are kept as small as possible (no build tools pre-installed).
Using Alpine Linux reduces the built image size, but removes standard dependencies that are required for native module compilation. If you want to add dependencies with native dependencies, extend the Node-RED image with the missing packages on running containers or build new images see [docker-custom](docker-custom/README.md).

The following table shows the variation of provided Node-RED images.

|**Tag** | **Node** | **Arch** |**OS** | **Python** | **GPIO** | **Base Image** |
|----------------------------------|----------|----------|--------|------------|----------|------------------------|
| 0.20.7-10-alpine-amd64 | 10 | amd64 | alpine | no | no | amd64/node:10-alpine |
| 0.20.7-10-alpine-arm32v6 | 10 | arm32v6 | alpine | no | no | arm32v6/node:10-alpine |
| 0.20.7-10-alpine-arm32v7 | 10 | arm32v7 | alpine | no | no | arm32v7/node:10-alpine |
| 0.20.7-10-alpine-arm64v8 | 10 | arm64v8 | alpine | no | no | arm64v8/node:10-alpine |
||
| 0.20.7-10-alpine-amd64-python3 | 10 | amd64 | alpine | 3.x | no | amd64/node:10-alpine |
| 0.20.7-10-alpine-arm32v6-python3 | 10 | arm32v6 | alpine | 3.x | yes | arm32v6/node:10-alpine |
| 0.20.7-10-alpine-arm32v7-python3 | 10 | arm32v7 | alpine | 3.x | yes | arm32v7/node:10-alpine |
| 0.20.7-10-alpine-arm64v8-python3 | 10 | arm64v8 | alpine | 3.x | no | arm64v8/node:10-alpine |
||
| 0.20.7-10-alpine-amd64-python2 | 10 | amd64 | alpine | 2.x | no | amd64/node:10-alpine |
| 0.20.7-10-alpine-arm32v6-python2 | 10 | arm32v6 | alpine | 2.x | yes | arm32v6/node:10-alpine |
| 0.20.7-10-alpine-arm32v7-python2 | 10 | arm32v7 | alpine | 2.x | yes | arm32v7/node:10-alpine |
| 0.20.7-10-alpine-arm64v8-python2 | 10 | arm64v8 | alpine | 2.x | no | arm64v8/node:10-alpine |
|----------------------------------|----------|----------|--------|------------|----------|------------------------|
| 0.20.7-12-alpine-amd64 | 12 | amd64 | alpine | no | no | amd64/node:12-alpine |
| 0.20.7-12-alpine-arm32v6 | 12 | arm32v6 | alpine | no | no | arm32v6/node:12-alpine |
| 0.20.7-12-alpine-arm32v7 | 12 | arm32v7 | alpine | no | no | arm32v7/node:12-alpine |
| 0.20.7-12-alpine-arm64v8 | 12 | arm64v8 | alpine | no | no | arm64v8/node:12-alpine |
||
| 0.20.7-12-alpine-amd64-python3 | 12 | amd64 | alpine | 3.x | no | amd64/node:12-alpine |
| 0.20.7-12-alpine-arm32v6-python3 | 12 | arm32v6 | alpine | 3.x | yes | arm32v6/node:12-alpine |
| 0.20.7-12-alpine-arm32v7-python3 | 12 | arm32v7 | alpine | 3.x | yes | arm32v7/node:12-alpine |
| 0.20.7-12-alpine-arm64v8-python3 | 12 | arm64v8 | alpine | 3.x | no | arm64v8/node:12-alpine |
||
| 0.20.7-12-alpine-amd64-python2 | 12 | amd64 | alpine | 2.x | no | amd64/node:12-alpine |
| 0.20.7-12-alpine-arm32v6-python2 | 12 | arm32v6 | alpine | 2.x | yes | arm32v6/node:12-alpine |
| 0.20.7-12-alpine-arm32v7-python2 | 12 | arm32v7 | alpine | 2.x | yes | arm32v7/node:12-alpine |
| 0.20.7-12-alpine-arm64v8-python2 | 12 | arm64v8 | alpine | 2.x | no | arm64v8/node:12-alpine |

The Node-RED images have either no Python, Python 3.x or Python 2.x pre-installed and for arm32v6 and arm32v7 Node-RED build-in GPIO enabled.

All images have bash, nano, curl git, openssl tools pre-installed to support Node-red's Projects feature.
All images have bash, tzdata, nano, curl git and openssl tools pre-installed to support Node-red's Projects feature.

_**Note**: Python 2.7 will reach the end of its life on January 1st, 2020! Therefore it's highly recommended to use Python 3 based images, if you need Python pre-installed._

_**Note**: Base image arm32v7/node:10-alpine is not available [#1081](https://github.com/nodejs/docker-node/issues/1081). As soon as it is available buster-slim images might be replaced by it._

## Manifest Lists

The following table shows the provided Manifest Lists.

| **Tag** | **Node-RED Base Image** |
|----------------------------------------|--------------------------------------------------------------|
| latest, 0.20.7 | raymondmm/0.20.7-10-alpine-amd64 |
| | raymondmm/0.20.7-10-alpine-arm32v6 |
| | raymondmm/~~0.20.7-10-alpine-arm32v7~~ |
| | raymondmm/0.20.7-10-buster-slim-arm32v7 |
| | raymondmm/0.20.7-10-alpine-arm64v8 |
| | |
| latest-python3, 0.20.7-python3 | raymondmm/0.20.7-10-alpine-amd64-python3 |
| | raymondmm/0.20.7-10-alpine-arm32v6-python3 |
| | raymondmm/~~0.20.7-10-alpine-arm32v7-python3~~ |
| | raymondmm/0.20.7-10-buster-slim-arm32v7-python3 |
| | raymondmm/0.20.7-10-alpine-arm64v8-python3 |
| | |
| latest-python2, 0.20.7-python2 | raymondmm/0.20.7-10-alpine-amd64-python2 |
| | raymondmm/0.20.7-10-alpine-arm32v6-python2 |
| | raymondmm/~~0.20.7-10-alpine-arm32v7-python2~~ |
| | raymondmm/0.20.7-10-buster-slim-arm32v7-python2 |
| | raymondmm/0.20.7-10-alpine-arm64v8-python2 |
| **Tag** | **Node-RED Base Image** |
|----------------------------------------|---------------------------------------------------------------|
| latest, 0.20.7, | raymondmm/0.20.7-10-alpine-amd64 |
| latest-10, 0.20.7-10 | raymondmm/0.20.7-10-alpine-arm32v6 |
| | raymondmm/0.20.7-10-alpine-arm32v7 |
| | raymondmm/0.20.7-10-alpine-arm64v8 |
| | |
| latest-python3, 0.20.7-python3, | raymondmm/0.20.7-10-alpine-amd64-python3 |
| latest-10-python3, 0.20.7-10-python3 | raymondmm/0.20.7-10-alpine-arm32v6-python3 |
| | raymondmm/0.20.7-10-alpine-arm32v7-python3 |
| | raymondmm/0.20.7-10-alpine-arm64v8-python3 |
| | |
| latest-python2, 0.20.7-python2 | raymondmm/0.20.7-10-alpine-amd64-python2 |
| latest-10-python2, 0.20.7-10-python2 | raymondmm/0.20.7-10-alpine-arm32v6-python2 |
| | raymondmm/0.20.7-10-alpine-arm32v7-python2 |
| | raymondmm/0.20.7-10-alpine-arm64v8-python2 |

## Raspberry PI Tags
| **Tag** | **Node-RED Base Image Tag** | **Description** |
|----------------------------------------|---------------------------------------|----------------------|
| latest-rpi, 0.20.7-rpi | 0.20.7-10-alpine-arm32v6 | rpi 1, 2, 3, 4, zero |
| | 0.20.7-10-buster-slim-arm32v7 | |
| **Tag** | **Node-RED Base Image Tag** | **Description** |
|----------------------------------------------|----------------------------------|----------------------|
| latest-rpi, 0.20.7-rpi, | 0.20.7-10-alpine-arm32v6 | rpi 1, 2, 3, 4, zero |
| latest-10-rpi, 0.20.7-10-rpi | 0.20.7-10-alpine-arm32v7 | |
||
| latest-rpi-python3, 0.20.7-rpi-python3 | 0.20.7-10-alpine-arm32v6-python3 | rpi 1, 2, 3, 4, zero |
| | 0.20.7-10-buster-slim-arm32v7-python3 | |
| latest-rpi-python3, 0.20.7-rpi-python3, | 0.20.7-10-alpine-arm32v6-python3 | rpi 1, 2, 3, 4, zero |
| latest-10-rpi-python3, 0.20.7-10-rpi-python3 | 0.20.7-10-alpine-arm32v7-python3 | |
||
| latest-rpi-python2, 0.20.7-rpi-python2 | 0.20.7-10-alpine-arm32v6-python2 | rpi 1, 2, 3, 4, zero |
| | 0.20.7-10-buster-slim-arm32v7-python2 | |

| latest-rpi-python2, 0.20.7-rpi-python2, | 0.20.7-10-alpine-arm32v6-python2 | rpi 1, 2, 3, 4, zero |
| latest-10-rpi-python2, 0.20.7-10-rpi-python2 | 0.20.7-10-alpine-arm32v7-python2 | |
|----------------------------------------------|----------------------------------|----------------------|
| latest-rpi, 0.20.7-rpi, | 0.20.7-12-alpine-arm32v6 | rpi 1, 2, 3, 4, zero |
| latest-12-rpi, 0.20.7-12-rpi | 0.20.7-12-alpine-arm32v7 | |
||
| latest-rpi-python3, 0.20.7-rpi-python3, | 0.20.7-12-alpine-arm32v6-python3 | rpi 1, 2, 3, 4, zero |
| latest-12-rpi-python3, 0.20.7-12-rpi-python3 | 0.20.7-12-alpine-arm32v7-python3 | |
||
| latest-rpi-python2, 0.20.7-rpi-python2, | 0.20.7-12-alpine-arm32v6-python2 | rpi 1, 2, 3, 4, zero |
| latest-12-rpi-python2, 0.20.7-12-rpi-python2 | 0.20.7-12-alpine-arm32v7-python2 | |

With the support of Docker manifest list, there is no need to explicit add the tag for the architecture to use. 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. When it does, docker pulls the matching image for it.

Expand All @@ -177,11 +191,11 @@ Due to an open [issue](https://github.com/moby/moby/issues/34875) the above comm
However if you to make use of arm32v7 then specify it's corresponding tag explicit like this:

```
docker run -it -p 1880:1880 --name mynodered raymondmm/node-red:0.20.7-buster-slim-arm32v7
docker run -it -p 1880:1880 --name mynodered raymondmm/node-red:0.20.7-alpine-arm32v7
```
Or:
```
docker run -it -p 1880:1880 --name mynodered raymondmm/node-red:0.20.7-buster-slim-arm32v7-python3
docker run -it -p 1880:1880 --name mynodered raymondmm/node-red:0.20.7-alpine-arm32v7-python3
```

You can see a full list of the tagged releases [here](https://hub.docker.com/r/raymondmm/node-red/tags/).
Expand Down

0 comments on commit 42bfc86

Please sign in to comment.