Installation of libreoffice package in Docker container.
I'm trying to convert a JAVA application from Excel to a PDF file, but an error occurs. (The container is running on Google Cloud Run.)
The Dockerfile is below.
FROM maven:3.8-jdk-11
RUN apt-get -y update
RUN apt-get -y install libreoffice
RUN mvn package
FROM adoptopenjdk/openjdk11:alpine-jre
CMD ["java", "-jar", "/app.jar"]
The java code running in the container is below.
ProcessBuilder builder = new ProcessBuilder("/bin/sh", "-c", "soffice --headless -convert-to pdf --outdir '/out' '/out/file.xlsx'");
Process process = builder.start();
The error message that is output is as follows.
line 1: soffice:not found
After installing the package in the Dockerfile, when I executed the which command, usr/bin/libreoffice existed, so I think the path is correct. (I may be wrong)
I'm thinking that there might be information that's missing but I'm not so sure since I'm a newbie with Docker.
Any help would be greatly appreciated.