Mup: Issue with the "sharp" package

I’m using the sharp package for image processing, which is a transitive dependency of the "@gltf-transform/functions package.

It works fine on my local macOS machine.

However, when I try to deploy this to my EC2 instance, the “Verify Deployment” step fails with an error (see logs below).

I first thought this was because of a missing compiler toolchain, so I added these build instuctions to mup.js:

docker: {
      image: 'zodern/meteor:root',
      stopAppDuringPrepareBundle: false,
      buildInstructions: [
        'RUN apt-get update && apt-get install -y --no-install-recommends python3 make g++',
        'RUN rm -rf /var/lib/apt/lists/*'
      ]
    }

but this did not help either. How can I ensure that sharp can use the binaries it needs on Linux x64?

------------------------------------STDERR------------------------------------
	      1 (-> v22.13.1 *)
	=> Starting meteor app on port 3000
	(node:514) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
	(Use `node --trace-deprecation ...` to show where the warning was created)
	packages/core-runtime.js:189
	            throw error;
	            ^
	
	Error: Could not load the "sharp" module using the linux-x64 runtime
	Possible solutions:
	- Ensure optional dependencies can be installed:
	    npm install --include=optional sharp
	- Ensure your package manager supports multi-platform installation:
	    See https://sharp.pixelplumbing.com/install#cross-platform
	- Add platform-specific dependencies:
	    npm install --os=linux --cpu=x64 sharp
	- Consult the installation documentation:
	    See https://sharp.pixelplumbing.com/install
	    at Object.<anonymous> (/built_app/programs/server/npm/node_modules/sharp/lib/sharp.js:120:9)
	    at Module.<anonymous> (node:internal/modules/cjs/loader:1562:14)
	    at Module.Mp._compile (/tools/static-assets/server/runtime.js:78:21)
	    at Object..js (node:internal/modules/cjs/loader:1699:10)
	    at Module.<anonymous> (node:internal/modules/cjs/loader:1313:32)
	    at Module.Mp.load (/tools/static-assets/server/runtime.js:35:31)
	    at Function._load (node:internal/modules/cjs/loader:1123:12)
	    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
	    at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
	    at Module.<anonymous> (node:internal/modules/cjs/loader:1335:12)
	    at Module.mod.require (/built_app/programs/server/node_modules/@meteorjs/reify/lib/runtime/index.js:30:33)
	    at require (node:internal/modules/helpers:136:16)
	    at Object.<anonymous> (/built_app/programs/server/npm/node_modules/sharp/lib/constructor.js:10:1)
	    at Module.<anonymous> (node:internal/modules/cjs/loader:1562:14)
	    at Module.Mp._compile (/tools/static-assets/server/runtime.js:78:21)
	    at Object..js (node:internal/modules/cjs/loader:1699:10)
	
	Node.js v22.13.1
	=> Setting node version
	NODE_VERSION=22.13.1
	Node: 22.13.1 (parsed: 22.13.1)
	Using NVM
	v22.13.1 is already installed.
	Now using node v22.13.1 (npm v10.9.2)
	default -> 22.13.1 (-> v22.13.1 *)
	=> Starting meteor app on port 3000
	(node:513) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
	(Use `node --trace-deprecation ...` to show where the warning was created)
	packages/core-runtime.js:189
	            throw error;
	            ^
	
	Error: Could not load the "sharp" module using the linux-x64 runtime
	Possible solutions:
	- Ensure optional dependencies can be installed:
	    npm install --include=optional sharp
	- Ensure your package manager supports multi-platform installation:
	    See https://sharp.pixelplumbing.com/install#cross-platform
	- Add platform-specific dependencies:
	    npm install --os=linux --cpu=x64 sharp
	- Consult the installation documentation:
	    See https://sharp.pixelplumbing.com/install
	    at Object.<anonymous> (/built_app/programs/server/npm/node_modules/sharp/lib/sharp.js:120:9)
	    at Module.<anonymous> (node:internal/modules/cjs/loader:1562:14)
	    at Module.Mp._compile (/tools/static-assets/server/runtime.js:78:21)
	    at Object..js (node:internal/modules/cjs/loader:1699:10)
	    at Module.<anonymous> (node:internal/modules/cjs/loader:1313:32)
	    at Module.Mp.load (/tools/static-assets/server/runtime.js:35:31)
	    at Function._load (node:internal/modules/cjs/loader:1123:12)
	    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
	    at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
	    at Module.<anonymous> (node:internal/modules/cjs/loader:1335:12)
	    at Module.mod.require (/built_app/programs/server/node_modules/@meteorjs/reify/lib/runtime/index.js:30:33)
	    at require (node:internal/modules/helpers:136:16)
	    at Object.<anonymous> (/built_app/programs/server/npm/node_modules/sharp/lib/constructor.js:10:1)
	    at Module.<anonymous> (node:internal/modules/cjs/loader:1562:14)
	    at Module.Mp._compile (/tools/static-assets/server/runtime.js:78:21)
	    at Object..js (node:internal/modules/cjs/loader:1699:10)
	
	Node.js v22.13.1
	 
	=> Redeploying previous version of the app

There is also a special section about cross-platform in their docs:

It recommends to install the package for a specific target. But how can I do this in a way that both my local machine and my EC2 instance can use it?