fokan commited on
Commit
ff4fc54
·
verified ·
1 Parent(s): 7d3b1e2

Upload 49 files

Browse files
Files changed (1) hide show
  1. Dockerfile +23 -4
Dockerfile CHANGED
@@ -43,10 +43,29 @@ RUN locale-gen ar_SA.UTF-8
43
  # Update font cache
44
  RUN fc-cache -fv
45
 
46
- # Copy and run LibreOffice initialization script
47
- COPY init_libreoffice.sh /usr/local/bin/init_libreoffice.sh
48
- RUN chmod +x /usr/local/bin/init_libreoffice.sh
49
- RUN /usr/local/bin/init_libreoffice.sh
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
 
51
  # Set working directory
52
  WORKDIR /app
 
43
  # Update font cache
44
  RUN fc-cache -fv
45
 
46
+ # Fix LibreOffice Java integration issues - Comprehensive fix
47
+ # Create all necessary LibreOffice directories with proper permissions
48
+ RUN mkdir -p /tmp/.config/libreoffice/4/user \
49
+ /usr/lib/libreoffice/share/fonts/truetype \
50
+ /usr/lib/libreoffice/share/fonts/type1 \
51
+ && chmod -R 777 /tmp/.config \
52
+ && chmod -R 777 /usr/lib/libreoffice/share/fonts || true
53
+
54
+ # Create empty registrymodifications.xcu to prevent initialization errors
55
+ RUN echo '<?xml version="1.0" encoding="UTF-8"?>\
56
+ <oor:items xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\
57
+ <!-- Disable first start wizard and user installation -->\
58
+ <item oor:path="/org.openoffice.Setup/Office/Factories/org.openoffice.Setup:Factory['\''com.sun.star.comp.framework.ProtocolHandler'\'']">\
59
+ <prop oor:name="FirstStartWizardCompleted" oor:op="fuse">\
60
+ <value>true</value>\
61
+ </prop>\
62
+ </item>\
63
+ </oor:items>' > /tmp/.config/libreoffice/4/user/registrymodifications.xcu \
64
+ && chmod 666 /tmp/.config/libreoffice/4/user/registrymodifications.xcu
65
+
66
+ # Pre-initialize LibreOffice to avoid first-run errors - More comprehensive approach
67
+ # Run LibreOffice with specific flags to complete initial setup
68
+ RUN HOME=/tmp timeout 30 libreoffice --headless --invisible --nologo --norestore --nofirststartwizard --safe-mode --version || true
69
 
70
  # Set working directory
71
  WORKDIR /app