Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
184 views
in Technique[技术] by (71.8m points)

node.js - How to add fonts to docker image

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...