I'm using node node:15-slim for building nodejs image. Apparently this image doesn't have any fonts included. So Fontconfig error: Cannot load default config file: No such file: (null)
appears.
I added .fonts/Ubuntu-Light.ttf
into my project and tried to copy that file in Dockerfile
FROM node:15-slim
COPY .fonts .fonts/ <-- Here I copy
WORKDIR /app
COPY package*.json /app/
RUN npm install
COPY src/* /app/src/
COPY tsconfig.json /app/
RUN npm run build
But it doesn't help. I don't want to use not slim version and hoping to find solution
Thanks in advance!
question from:
https://stackoverflow.com/questions/65899222/how-to-add-fonts-to-docker-image 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…