Open MurakamiShinyu opened 2 years ago
Current vivliostyle-cli docker image size is very big because of installed fonts,
- install all Noto fonts (including Noto CJK fonts, such as "Noto Serif CJK JP" and "Noto Sans CJK JP")
To reduce the docker image size, we might need to reconsider the installed fonts.
Previously, we reduced the Docker image size by not installing WebKit and Firefox that are installed in the Playwright official Docker image:
https://github.com/vivliostyle/vivliostyle-cli/pull/309
However, the latest Docker image ghcr.io/vivliostyle/cli:5.2.1 size is bigger (2.25GB) because we added large fonts in the Docker image:
https://github.com/vivliostyle/vivliostyle-cli/pull/310
I tried to further reduce the image size, but without success.
I tried to use "node:16-buster-slim" as base instead of "ubuntu:focal" and nodejs install but got warning "your OS is not officially supported by Playwright" and error "E: Package 'ttf-ubuntu-font-family' has no installation candidate".
Then, I tried to uninstall python3.8 that was installed when nodejs was installed:
https://github.com/vivliostyle/vivliostyle-cli/blob/0acdd2858b7fa51d33304e621c3c129d9a808ab0/Dockerfile#L15-L16
I tried to purge all python3* packages by
apt-get purge -y libpython3-stdlib libpython3.8-minimal libpython3.8-stdlib python3 python3-minimal python3.8 python3.8-minimal
. The result was that it removed not only python3 but also nodejs. (nodejs depends on python3-minimal)... I realized that removing python3 packages is not very good idea. It's less effective, the saving size will be about 24MB that is not very large compared to the current Docker image size.