RocketChat / RocketChat/Docker.Official.Image

It fails to run on arm64 architecture because of sharp.node

Open
#49 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Dockerfile
Stars
337
Forks
228
Avg merge
3d 10h
Merged PRs (30d)
5

Description

Hi,

With the "fix" mentioned in issue #48, I can successfully build rocket.chat image on arm64 architecture. But when trying to run the image, I got the following exception caused by sharp.node.

$ docker run --name rocketchat -p 80:3000 --env ROOT_URL=http://localhost --link db:db rocket.chat
Note: you are using a pure-JavaScript implementation of bcrypt.
While this implementation will work correctly, it is known to be
approximately three times slower than the native implementation.
In order to use the native implementation instead, run

  meteor npm install --save bcrypt

in the root directory of your application.
Will load cache for users
0 records load from users
Will load cache for rocketchat_room
0 records load from rocketchat_room
Will load cache for rocketchat_subscription
0 records load from rocketchat_subscription
Will load cache for rocketchat_settings
373 records load from rocketchat_settings
Updating process.env.MAIL_URL
Starting Email Intercepter...
Will load cache for rocketchat_permissions
0 records load from rocketchat_permissions
Will load cache for rocketchat_roles
0 records load from rocketchat_roles
Exception in callback of async function: Error: /app/bundle/programs/server/npm/node_modules/sharp/build/Release/sharp.node: cannot open shared object file: No such file or directory
    at Object.Module._extensions..node (module.js:681:18)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/app/bundle/programs/server/npm/node_modules/sharp/lib/constructor.js:10:15)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/app/bundle/programs/server/npm/node_modules/sharp/lib/index.js:3:15)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at npmRequire (/app/bundle/programs/server/npm-require.js:133:10)
    at Module.useNode (packages/modules-runtime.js:697:18)
    at fileEvaluate (packages/modules-runtime.js:342:20)
    at require (packages/modules-runtime.js:238:16)
    at FileUpload.js (packages/rocketchat:file-upload/server/lib/FileUpload.js:1:351)
    at fileEvaluate (packages/modules-runtime.js:343:9)
    at require (packages/modules-runtime.js:238:16)
    at /app/bundle/programs/server/packages/rocketchat_file-upload.js:2252:1
    at /app/bundle/programs/server/packages/rocketchat_file-upload.js:2266:3
    at /app/bundle/programs/server/boot.js:411:36
    at Array.forEach (<anonymous>)
    at /app/bundle/programs/server/boot.js:220:19
    at /app/bundle/programs/server/boot.js:471:5
    at Function.run (/app/bundle/programs/server/profile.js:510:12)
    at /app/bundle/programs/server/boot.js:470:11

The cause is that this sharp.node in meteor bundle is an x86-64 executable file.

$ file bundle/programs/server/npm/node_modules/sharp/build/Release/sharp.node
bundle/programs/server/npm/node_modules/sharp/build/Release/sharp.node: ELF 64-bit LSB  shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=f0b3b64efe073fbfdd69b6a2778eb95102b58431, stripped

It seems that we should build this sharp package from source rather than always having a x86-64 binary in there? Thanks.

Shawn

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the Docker image build that produces bundle/programs/server/npm/node_modules/sharp/build/Release/sharp.node and reproduce the failure with the reported docker run command on arm64. Verify how the sharp dependency is installed and built. Done means the arm64 image starts without the sharp.node loading error while preserving the existing image behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, node.js
Domain
build-system, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.