Docker images for running LibreOffice on Windows containers with .NET 10 runtime.
This repository provides Windows container images that include:
Perfect for server-side document conversion, generation, and processing in a containerized Windows environment.
Images are available on Docker Hub: surgicalcoder/dotnet-libreoffice
| Tag | Base Image | Size | Use Case |
|---|---|---|---|
nanoserver-ltsc2022 | Nano Server LTSC 2022 | Smallest | Minimal footprint, headless operations |
nanoserver-ltsc2025 | Nano Server LTSC 2025 | Smallest | Latest Nano Server, minimal footprint |
windowsservercore-ltsc2022 | Windows Server Core LTSC 2022 | Larger | Full compatibility, GUI components |
windowsservercore-ltsc2025 | Windows Server Core LTSC 2025 | Larger | Latest Server Core, full compatibility |
docker pull surgicalcoder/dotnet-libreoffice:windowsservercore-ltsc2025
docker run -it surgicalcoder/dotnet-libreoffice:windowsservercore-ltsc2025
# Mount a volume with your documents
docker run -v C:\Documents:C:\docs surgicalcoder/dotnet-libreoffice:windowsservercore-ltsc2025 `
C:\apps\libreoffice\libreoffice\program\soffice.exe --headless --convert-to pdf C:\docs\input.docx --outdir C:\docs
FROM surgicalcoder/dotnet-libreoffice:windowsservercore-ltsc2025
WORKDIR /app
COPY MyApp/ .
# Your application that uses LibreOffice
ENTRYPOINT ["dotnet", "MyApp.dll"]
The following environment variables are set in all images:
LIBREOFFICE_DIR - LibreOffice installation directory: C:\apps\libreoffice\libreofficeLIBREOFFICE_PATH - Full path to soffice.exe: C:\apps\libreoffice\libreoffice\program\soffice.exePATH - Includes LibreOffice program directory for direct command accessLibreOffice is installed at: C:\apps\libreoffice\
Executable location: C:\apps\libreoffice\libreoffice\program\soffice.exe
# Convert DOCX to PDF
soffice.exe --headless --convert-to pdf document.docx
# Convert with output directory
soffice.exe --headless --convert-to pdf document.docx --outdir C:\output
# Convert multiple files
soffice.exe --headless --convert-to pdf *.docx --outdir C:\output
# Convert to different formats
soffice.exe --headless --convert-to html document.docx
soffice.exe --headless --convert-to odt document.docx
# Process all Word documents in a directory
Get-ChildItem C:\input\*.docx | ForEach-Object {
docker run -v C:\input:C:\input -v C:\output:C:\output `
surgicalcoder/dotnet-libreoffice:windowsservercore-ltsc2025 `
soffice.exe --headless --convert-to pdf $_.FullName --outdir C:\output
}
source/ directory# Clone the repository
git clone https://github.com/yourusername/WindowsLibreOfficeDocker.git
cd WindowsLibreOfficeDocker
# Place LibreOffice files in source/ directory
# Ensure source/libreoffice/ contains the LibreOffice installation
# Build a specific variant
docker build -f docker/base/Dockerfile.windowsservercore-ltsc2025 `
--build-arg DOTNET_VERSION=10.0.3 `
-t dotnet-libreoffice:windowsservercore-ltsc2025 `
build-context
This repository includes GitHub Actions workflows that automatically build and publish all image variants when changes are pushed to the main branch.
WindowsLibreOfficeDocker/
├── .github/
│ └── workflows/
│ └── build-docker.yml # CI/CD pipeline
├── docker/
│ └── base/
│ ├── Dockerfile.nanoserver-ltsc2022
│ ├── Dockerfile.nanoserver-ltsc2025
│ ├── Dockerfile.windowsservercore-ltsc2022
│ └── Dockerfile.windowsservercore-ltsc2025
├── source/
│ └── libreoffice/ # LibreOffice installation files
│ ├── program/
│ ├── share/
│ └── presets/
├── .dockerignore # Build context optimization
└── README.md
Ensure you're using the correct base image for your Windows version. Windows containers must match the host OS version.
Make sure mounted volumes have proper permissions. Use absolute paths when mounting volumes.
Increase Docker memory limits in Docker Desktop settings. LibreOffice document processing can be memory-intensive.
See LICENSE file for details.
Contributions are welcome! Please submit issues and pull requests on GitHub.
For issues related to:
Content type
Image
Digest
sha256:debf5e8c8…
Size
2 GB
Last updated
7 months ago
docker pull surgicalcoder/dotnet-libreoffice:windowsservercore-ltsc2025