plankanban / planka

The realtime kanban board for workgroups built with React and Redux.
https://planka.app
GNU Affero General Public License v3.0
7.84k stars 729 forks source link

Building for ARMv7 #47

Closed breakingflower closed 3 years ago

breakingflower commented 3 years ago

I wanted to build for ARMv7 using your Dockerfile, straight from docker-compose.

Usefull system info:

pi@naspi:~/rpi4_server $ cat /proc/device-tree/model
Raspberry Pi 4 Model B Rev 1.1
pi@naspi:~/rpi4_server $ uname -a 
Linux naspi 5.4.51-v7l+ #1333 SMP Mon Aug 10 16:51:40 BST 2020 armv7l GNU/Linux
pi@naspi:~/rpi4_server $ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 10 (buster)
Release:        10
Codename:       buster
pi@naspi:~/rpi4_server $ docker --version
Docker version 19.03.13, build 4484c46
pi@naspi:~/rpi4_server $ docker-compose --version
docker-compose version 1.27.4, build unknown

The docker-compose build is unknown due to it being installed with pip3 (only way to get up to date docker-compose version).

I use the following compose file, copied largely from this

  planka:
    image: fremmen/planka:armv7
    build: https://github.com/plankanban/planka.git
    command: >
      bash -c
        "for i in `seq 1 30`; do
          ./start.sh &&
          s=$$? && break || s=$$?;
          echo \"Tried $$i times. Waiting 5 seconds...\";
          sleep 5;
        done; (exit $$s)"
    restart: unless-stopped
    volumes:
      - ${CLOUD_ROOT}/planka/user-avatars:/app/public/user-avatars
      - ${CLOUD_ROOT}/planka/project-background-images:/app/public/project-background-images
      - ${CLOUD_ROOT}/planka/attachments:/app/public/attachments
    ports:
      - "${PLANKA_PORT}:1337"
    environment:
      - BASE_URL=XXXXXX
      - DATABASE_URL=postgresql://postgres@postgres/planka
      - SECRET_KEY=XXXXXXXX
    depends_on:
      - plankadb

Building the fremmen/planka:arm image is done using docker-compose build planka. The following errors occur:

Step 5/26 : RUN npm i --prod --silent
 ---> Running in b30dd6e60991
make: Entering directory '/app/node_modules/bcrypt/build'
  CC(target) Release/obj.target/nothing/../node-addon-api/nothing.o
  AR(target) Release/obj.target/../node-addon-api/nothing.a
  COPY Release/nothing.a
  CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
  SOLINK_MODULE(target) Release/obj.target/bcrypt_lib.node
  COPY Release/bcrypt_lib.node
  COPY /app/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node
  TOUCH Release/obj.target/action_after_build.stamp
make: Leaving directory '/app/node_modules/bcrypt/build'
info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.10.0/libvips-8.10.0-linuxmusl-armv7.tar.br
ERR! sharp Prebuilt libvips 8.10.0 binaries are not yet available for linuxmusl-armv7
info sharp Attempting to build from source via node-gyp but this may fail due to the above error
info sharp Please see https://sharp.pixelplumbing.com/install for required dependencies
make: Entering directory '/app/node_modules/sharp/build'
  TOUCH Release/obj.target/libvips-cpp.stamp
  CC(target) Release/obj.target/nothing/node_modules/node-addon-api/nothing.o
  AR(target) Release/obj.target/node_modules/node-addon-api/nothing.a
  COPY Release/nothing.a
  CXX(target) Release/obj.target/sharp/src/common.o
In file included from ../src/common.cc:24:
/usr/include/vips/vips8:35:10: fatal error: glib-object.h: No such file or directory
   35 | #include <glib-object.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
make: *** [sharp.target.mk:138: Release/obj.target/sharp/src/common.o] Error 1
make: Leaving directory '/app/node_modules/sharp/build'
ERROR: Service 'planka' failed to build : The command '/bin/sh -c npm i --prod --silent' returned a non-zero code: 1

The required dependencies for sharp show that there are no sharp prebuild libvips.

The following platforms have prebuilt libvips but not sharp:

    Linux ARMv6
    Linux ARMv7 (glibc >= 2.28)

Would be great to be able to build straight from GitHub for ARMv7!

breakingflower commented 3 years ago

Upon further inspection, it can be observed that the generated download link for the sharp binaries is incorrect

info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.10.0/libvips-8.10.0-linuxmusl-armv7.tar.br

I'm not sure why the linux version is translated into linuxmusl instead of just linux. Maybe this error is not planka related but sharp-libvips. The file https://github.com/lovell/sharp-libvips/releases/download/v8.10.2-alpha2/libvips-8.10.2-linux-armv7.tar.br does exist.

meltyshev commented 3 years ago

After a full day of trying, I was able to compile libvips from the source. Sharp is successfully installed after that. Checking how Planks works with that and will commit this.