【问题标题】:Adding Archive to Libre Office using Docker使用 Docker 将存档添加到 Libre Office
【发布时间】:2019-01-20 11:30:37
【问题描述】:

在一个文件夹中,我有两个文件:Dockerfile 和 postgresql-42.2.4.jar

Dockerfile:

from ubuntu:16.04
RUN apt-get update && apt-get install -y \
    libreoffice-base

COPY postgresql-42.2.4.jar postgresql-42.2.4.jar

CMD ["usr/bin/libreoffice"]

postgresql-42.2.4.jar:

我从PostgreSQL official site下载了 PostgreSQL JDBC 存档

要运行我使用的 docker:

docker build -t gui-app .

然后:

docker run --net=host --env="DISPLAY" --volume="$HOME/.Xauthority:/root/.Xauthority:rw" gui-app

Libre Office 运行正常,但是当我想添加类路径 (link to Libre help site) 时,我找不到我在 Dockerfile 中复制的 .jar 文件。

我没有手动安装 JRE,但我认为 JRE 是在 ubuntu 中构建的。

为什么我找不到 JDBC 归档文件?

【问题讨论】:

    标签: java postgresql docker libreoffice


    【解决方案1】:

    docker镜像ubuntu:16.04默认没有安装JRE。您可以通过运行检查已安装软件包的列表:

    docker run -it ubuntu:16.04 apt list
    

    您可以通过添加 default-jre 包在 Dockerfile 中安装默认 JRE:

    FROM ubuntu:16.04
    RUN apt-get update && apt-get install -y \
        libreoffice-base default-jre
    
    COPY postgresql-42.2.4.jar postgresql-42.2.4.jar
    
    CMD ["usr/bin/libreoffice"]
    

    【讨论】:

      猜你喜欢
      • 2022-08-10
      • 1970-01-01
      • 1970-01-01
      • 2021-09-29
      • 1970-01-01
      • 2011-09-27
      • 1970-01-01
      • 2012-08-09
      • 1970-01-01
      相关资源
      最近更新 更多