Add workaround for installing Noto Emoji for gitlab-puppeteer

This commit is contained in:
Clement Ho 2018-11-08 21:54:07 +00:00 committed by Stan Hu
parent 13fb60dfef
commit 962db60538
2 changed files with 47 additions and 1 deletions

View file

@ -1,4 +1,6 @@
FROM node:10-jessie
FROM node:10-stretch
ADD /scripts/ /scripts/
# Workaround for https://github.com/GoogleChrome/puppeteer/issues/290
RUN apt-get update \
@ -10,3 +12,5 @@ RUN apt-get update \
&& apt-get autoremove -yq \
&& apt-get clean -yqq \
&& rm -rf /var/lib/apt/lists/*
RUN /scripts/install-noto-emoji

42
scripts/install-noto-emoji Executable file
View file

@ -0,0 +1,42 @@
#!/bin/bash
# This script installs noto color emoji
apt-get update
apt-get install unzip
cat > ~/.fonts.conf << EOM
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<match target="scan">
<test name="family">
<string>Noto Color Emoji</string>
</test>
<edit name="scalable" mode="assign"><bool>true</bool></edit>
</match>
<match target="pattern">
<test name="prgname">
<string>chrome</string>
</test>
<edit name="family" mode="prepend_first">
<string>Noto Color Emoji</string>
</edit>
</match>
</fontconfig>
EOM
mkdir setup_fonts
cd setup_fonts
curl https://noto-website-2.storage.googleapis.com/pkgs/NotoColorEmoji-unhinted.zip -LO
unzip NotoColorEmoji-unhinted.zip
mkdir -p /usr/local/share/fonts
cp NotoColorEmoji.ttf /usr/local/share/fonts/
ls -la /usr/local/share/fonts/
chmod 644 /usr/local/share/fonts/NotoColorEmoji.ttf
fc-cache -fv
cd ..
rm -r setup_fonts
apt-get clean -yqq && rm -rf /var/lib/apt/lists/*