On-Premise installation
Customize Carbone docker
Create your own Carbone container
Introduction
We maintain our images on Docker Hub.
These images allow you to use Carbone in the best conditions. If, however, you have specific needs, such as installing specific fonts, choosing a particular version of LibreOffice, or include your own plugins.
Reference docker image
Carbone reference image are available on Docker Hub.
You can choose between 3 variants:
slim
: Minimal version of Carbone. This image does not include Libreoffice (no PDF generation possible).latest
,full
: Full version of Carbone including the latest version of LibreOfficelatest-fonts
,full-fonts
: Full version of Carbone including the latest version of LibreOffice. This version also includes all Google Fontsā (royalty-free).
The reference Dockerfile
can be found in the Github repository.
Install your own fonts
To install your own fonts, we recommend first you read our documentation on font support.
You need to have one or more .ttf
files available for inclusion in your image.
Here's an example of a Dockerfile
:
FROM carbone/carbone-ee:latest
USER root
RUN mkdir /usr/share/fonts/custom_fonts
COPY ./*.ttf /usr/share/fonts/custom_fonts
RUN fc-cache -f -v
USER carbone
ENTRYPOINT ["./docker-entrypoint.sh"]
CMD ["webserver"]
Then build your image
docker build --tag my-carbone .
Install the LibreOffice version of your choice
To use Carbone with a specific version of LibreOffice, you need to create a new image starting from our slim
image.
Here's an example of a Dockerfile that installs LibreOffice 7.6.7.2 :
FROM debian:stable-slim AS downloader
ADD https://downloadarchive.documentfoundation.org/libreoffice/old/7.6.7.2/deb/x86_64/LibreOffice_7.6.7.2_Linux_x86-64_deb.tar.gz /libreoffice.tar.gz
FROM carbone/carbone-ee:slim
USER root
RUN apt update && \n apt install -y libnss3 libxinerama1 libdbus-glib-1-2 libcairo2 libcups2 openssl
RUN --mount=type=bind,from=downloader,target=/tmp/libreoffice.tar.gz,source=libreoffice.tar.gz \n tar -zxf /tmp/libreoffice.tar.gz && \n dpkg -i LibreOffice*_Linux_*_deb/DEBS/*.deb && \n rm -r LibreOffice*
USER carbone
ENTRYPOINT ["./docker-entrypoint.sh"]
CMD ["webserver"]
Then build your image
docker build --tag my-carbone .
Installing your plugins
To integrate your plugins into your image, we recommend that you start with our full
or full-fonts
reference image and add your plugins to it.
Here's an example of how to add your own formatters developed in the formatters.js
file:
FROM carbone/carbone-ee:full
USER root
COPY --chown=carbone:nogroup ./formatters.js /app/plugin/
USER carbone
ENTRYPOINT ["./docker-entrypoint.sh"]
CMD ["webserver"]
Then build your image
docker build --tag my-carbone .