janvda / docker-compose-with-node-red-flows

Sample docker-compose application consisting of a simple node-red application including its flows. The Node-RED flows in this github repository can be updated using the Node-RED editor in combination with Node-RED's project functionality.
Eclipse Public License 2.0
3 stars 0 forks source link

[linux/arm/v7 3/4] RUN cd /data ; npm install ... gives exec format error #1

Open janvda opened 1 year ago

janvda commented 1 year ago
Starting the build ...
docker buildx build  --push --platform linux/amd64,linux/arm/v7  \
                                --tag janvda/voice-kit-controller:latest \
                            --tag janvda/voice-kit-controller:1.0.0 .
[+] Building 1.6s (13/14)                                                                                                               
 => [internal] load build definition from Dockerfile                                                                               0.0s
 => => transferring dockerfile: 520B                                                                                               0.0s
 => [internal] load .dockerignore                                                                                                  0.0s
 => => transferring context: 2B                                                                                                    0.0s
 => [linux/arm/v7 internal] load metadata for docker.io/nodered/node-red:3.0.2-16                                                  1.4s
 => [linux/amd64 internal] load metadata for docker.io/nodered/node-red:3.0.2-16                                                   1.0s
 => [auth] nodered/node-red:pull token for registry-1.docker.io                                                                    0.0s
 => [linux/arm/v7 1/4] FROM docker.io/nodered/node-red:3.0.2-16@sha256:524316b9b84cb5bbfe006c117f3dad31ee806804b12e4b866047a65e20  0.0s
 => => resolve docker.io/nodered/node-red:3.0.2-16@sha256:524316b9b84cb5bbfe006c117f3dad31ee806804b12e4b866047a65e2080e92d         0.0s
 => [internal] load build context                                                                                                  0.0s
 => => transferring context: 129B                                                                                                  0.0s
 => [linux/amd64 1/4] FROM docker.io/nodered/node-red:3.0.2-16@sha256:524316b9b84cb5bbfe006c117f3dad31ee806804b12e4b866047a65e208  0.0s
 => => resolve docker.io/nodered/node-red:3.0.2-16@sha256:524316b9b84cb5bbfe006c117f3dad31ee806804b12e4b866047a65e2080e92d         0.0s
 => CACHED [linux/amd64 2/4] COPY --chown=node-red:node-red package.json /data/                                                    0.0s
 => CACHED [linux/amd64 3/4] RUN  cd /data ; npm install --unsafe-perm --no-update-notifier --no-fund --only=production            0.0s
 => CACHED [linux/amd64 4/4] COPY --chown=node-red:node-red flows.json flows_cred.json settings.js /data/                          0.0s
 => CACHED [linux/arm/v7 2/4] COPY --chown=node-red:node-red package.json /data/                                                   0.0s
 => ERROR [linux/arm/v7 3/4] RUN  cd /data ; npm install --unsafe-perm --no-update-notifier --no-fund --only=production            0.1s
------
 > [linux/arm/v7 3/4] RUN  cd /data ; npm install --unsafe-perm --no-update-notifier --no-fund --only=production:
#0 0.136 exec /bin/sh: exec format error
------
Dockerfile:6
--------------------
   4 |     # The following command will build all the nodes specified in the package.json that is copied
   5 |     # in previous command.
   6 | >>> RUN  cd /data ; npm install --unsafe-perm --no-update-notifier --no-fund --only=production
   7 |     
   8 |     # Copy Node-RED flow files and settings to userDir
--------------------
error: failed to solve: process "/bin/sh -c cd /data ; npm install --unsafe-perm --no-update-notifier --no-fund --only=production" did not complete successfully: exit code: 1
make: *** [buildx] Error 1
mac-jan:voice-kit-controller jan$ 
janvda commented 1 year ago

It is known issue apparently for buster on a raspberry pi.

I applied the fix:

The above fix makes that building on my pi3 works but building using buildx still gives the above error.