Closed vorant94 closed 1 year ago
Hi! The /tmp/xfs-51811beb/build.log
log file should describe what is missing. I think the most likely cause is: tdl includes a node addon that is pre-built for glibc-based linux distributions (as noted in the README), but needs to be built from source on musl-based distributions like alpine, requiring a C++ toolchain (and python) to be installed on the system, which the image probably doesn't contain out of the box.
So, you can fix it either by moving to e.g. debian or ubuntu, for example by replacing FROM node:18-alpine
with FROM node:18-bookworm
(just in case, prebuit-tdlib
also doesn't support alpine) or installing the build tools on alpine, something like RUN apk update && apk add gcc g++ python make
should work (the dockerfile can be split into two steps to reduce the size of the final image).
Note that to run the app in the container, you also need TDLib built for the system you use there, so brew install tdlib
on the host machine wouldn't be sufficient.
Hi! The
/tmp/xfs-51811beb/build.log
log file should describe what is missing. I think the most likely cause is: tdl includes a node addon that is pre-built for glibc-based linux distributions (as noted in the README), but needs to be built from source on musl-based distributions like alpine, requiring a C++ toolchain (and python) to be installed on the system, which the image probably doesn't contain out of the box.So, you can fix it either by moving to e.g. debian or ubuntu, for example by replacing
FROM node:18-alpine
withFROM node:18-bookworm
(just in case,prebuit-tdlib
also doesn't support alpine) or installing the build tools on alpine, something likeRUN apk update && apk add gcc g++ python make
should work (the dockerfile can be split into two steps to reduce the size of the final image).Note that to run the app in the container, you also need TDLib built for the system you use there, so
brew install tdlib
on the host machine wouldn't be sufficient.
thanks, changing base image to node:18-bookworm
worked!
regarding that tdlib
on host machine is not enough i am aware of it. i plan to pack it separately from the app in a container on its own, connect tdl
to it and then clean up host machine, so it will be always both locally and in prod deployed via docker. but in order to move forward with actual app code I postponed this stuff. the whole docker build issue raised now only because i wanted to setup github actions to be sure i don't push broken code
thank you once more for the help, have a nice day
Hi, there
I'm trying to make a small app in node and I need to use tdlib. I added it, locally everything works fine. Now I wanted to build a Docker container out of this app, but got an error during
yarn install
step. I'm not sure where to dig to fix a problem, can you please help me with it?Here is the .Dockerfile
Here is the error I receive during the build
All the source code in case you need it can be found here