Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with libreoffice #1527

Open
rrodrigofranco opened this issue Jul 8, 2024 · 2 comments
Open

Problem with libreoffice #1527

rrodrigofranco opened this issue Jul 8, 2024 · 2 comments

Comments

@rrodrigofranco
Copy link

rrodrigofranco commented Jul 8, 2024

I am using the php:7.4-fpm-alpine image, but when I try to install LibreOffice with the following command:

RUN apk add libreoffice \
          openjdk11-jre \
          xvfb \
          xorg-server \
          fontconfig \
          ttf-dejavu \
          ttf-droid \
          ttf-freefont \
          ttf-liberation \
          ttf-opensans \
          && rm -rf /var/cache/apk/*

and then attempt to convert a DOC or DOCX file to PDF, I encounter the following error:

/usr/lib/libreoffice/program/soffice.bin X11 error: Can't open display: 
  Set DISPLAY environment variable, use -display option
  or check permissions of your X-Server
  (See "man X" resp. "man xhost" for details)

The command I used is:
libreoffice --headless --convert-to pdf processo-administrativo-notificacao-08-07-2024-09-56-48.docx

Can someone help me resolve this issue?

@tianon
Copy link
Member

tianon commented Jul 8, 2024

I'm sorry, but I'm failing to understand what this has to do with the php image other than that you're using it as a base? The libreoffice package you're installing comes from Alpine, not from us, so there's not really much we can do/change to help you here. 😅

@LaurentGoderre
Copy link
Member

The problem is not with the image but with how the container is created/runs. The package expects a window system (X11) which needs to be defined when the container is created. I would recommend posting this question to the Docker Community Slack https://join.slack.com/t/dockercommunity/shared_invite/zt-2m79lx4uf-fHufHr6GO4ZBM5oqUHhIbg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants