Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
项目维护者,你们好。
最近需要在 arm64 架构机器上运行 kkfileview,我尝试通过该项目构建 arm64 架构镜像。
但非常令人沮丧,构建过程相当耗时,而且经常 connect timeout 。
并且我发现原先的 Dockerfile 写得有一些不合理之处,比如清理 apt 缓存文件的命令放到了靠后的单独RUN指令里,这就不会真正地减少镜像体积, 因为这些垃圾文件已经在前面通过RUN指令生成的镜像layer中存在了。
另外,一个简单的 Dockerfile 已经足够同时构建出 x86 和 arm 两种架构的镜像了。也不需要专门写一个 Dockerfile_arm64 文件,这不容易维护。现在的
docker buildx
功能已经相当好用了,我们需要支持它!因此我重写优化了 kkfileview-jdk 的 Dockerfile 文件。并成功构建出来了 arm64 架构镜像,经测试可以很好的工作。构建过程再也不需要源码编译 libreoffice 这些繁琐的操作。
一些升级点需要注意:
基础镜像使用了 ubuntu:24.04 ,
直接通过
apt install libreoffice
的方式安装了 libreoffice。(对应libreoffice 版本升级到了 24.2.2)考虑到可能存在的商用字体的版权问题,安装字体的步骤进行了注释和补充说明。
重新写了构建说明文档 README(若你们有需要,我再补充英文的)
Close #580
Close #574