Skip to content
Advertisement

Express Sharp install via Docker issue

I need to use sharp. Its work fine on my workspace but if I deploymeny via docker then I get error. I am implementation all steps.

JavaScript

I think sharp is prebuilt when first install. It uses the architecture of my computer(darwin, arm) But when it runs on the docker, although it gets built again, the work talks about the architecture of my computer.

I tried remove node_modules folder on my workspaces. – yarn pm2 not found npm install on docker running. – permission problems

My Dockerfile:

JavaScript

My .dockerignore.

JavaScript

docker build . When I do it, I see that sharp for my server is loaded among the docker logs.

JavaScript

My Docker-compose up log

JavaScript

I think, I need to install sharp on docker for pre-built proccess. I didn’t understand how docker works very well. it has to do with my amateurishness that I live with.

Relation Issue : linux-x64 binaries cannot be used on the linuxmusl-x64 platform error

Advertisement

Answer

Alpine uses musl for its C library. You can either use a different non-alpine based image such as node:12-buster-slim or any of the other non-Alpine tags here, or try to get it to work by setting up glibc with the instructions here. Using a Debian or Ubuntu based image would be the easiest way forward.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement