Sign inSign up

stplf/temurin17-libreoffice

By stplf

•Updated 4 months ago

Java 17 runtime based on Eclipse Temurin UBI 10 Minimal with LibreOffice 26.2.4 installed.

Image
Languages & frameworks
Developer tools
Operating systems
0

1.2K

stplf/temurin17-libreoffice repository overview

⁠Eclipse Temurin 17 JRE with LibreOffice 26.2.4 Headless (UBI 10 Minimal)

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).


⁠How to Use as a Base Image

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"]

⁠Path Reference

When executing commands from your Java application (e.g., using ProcessBuilder to invoke LibreOffice), the environment is configured with:

  • Java Runtime (java): Available in system PATH
  • LibreOffice (libreoffice / soffice): Symlinked to /usr/bin/libreoffice (points to /opt/libreoffice*/program/soffice)

⁠Java Invocation Example

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);
        }
    }
}

⁠Component Licensing

This image bundles several open-source components with their respective licenses:

  • Base OS (UBI): Red Hat UBI EULA
  • Java Runtime (Temurin): GPL-2.0 with Classpath Exception
  • LibreOffice: Mozilla Public License v2.0 (MPL-2.0)

Tag summary

Content type

Image

Digest

sha256:198856cb8…

Size

479 MB

Last updated

4 months ago

docker pull stplf/temurin17-libreoffice