Java 17 runtime based on Eclipse Temurin UBI 10 Minimal with LibreOffice 26.2.4 installed.
1.2K
A minimal, secure, and production-ready base image containing Eclipse Temurin 17 JRE and LibreOffice 26.2.4 (headless), built on top of Red Hat Universal Base Image (UBI) 10 Minimal.
This image is designed specifically to serve as a base image for Java/Spring Boot applications that interact with LibreOffice (e.g., to perform document conversions, PDF generation, or spreadsheet processing).
You can configure your Spring Boot application's Dockerfile to use this image as its parent:
FROM stplf/temurin17-libreoffice:latest
# Copy your packaged Spring Boot JAR application
COPY target/my-springboot-app.jar /app/app.jar
# Set the execution context
WORKDIR /app
EXPOSE 8080
# Run the Spring Boot application
ENTRYPOINT ["java", "-jar", "app.jar"]
When executing commands from your Java application (e.g., using ProcessBuilder to invoke LibreOffice), the environment is configured with:
java): Available in system PATHlibreoffice / soffice): Symlinked to /usr/bin/libreoffice (points to /opt/libreoffice*/program/soffice)You can invoke LibreOffice headless conversion from your Java/Spring Boot code using ProcessBuilder:
import java.io.File;
import java.io.IOException;
import java.util.List;
public class DocumentConverter {
public void convertToPdf(File inputFile, File outputDir) throws IOException, InterruptedException {
List<String> command = List.of(
"libreoffice",
"--headless",
"--convert-to", "pdf",
"--outdir", outputDir.getAbsolutePath(),
inputFile.getAbsolutePath()
);
ProcessBuilder pb = new ProcessBuilder(command);
pb.redirectErrorStream(true);
Process process = pb.start();
// Consume process output stream to prevent blocking
try (var is = process.getInputStream()) {
is.transferTo(System.out);
}
int exitCode = process.waitFor();
if (exitCode != 0) {
throw new RuntimeException("LibreOffice exited with code: " + exitCode);
}
}
}
This image bundles several open-source components with their respective licenses:
Content type
Image
Digest
sha256:198856cb8…
Size
479 MB
Last updated
4 months ago
docker pull stplf/temurin17-libreoffice