本文主要是介绍在linux上使用docker编译krita?,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
文章目录
- 1.前言
- 2.安装配置docker
- 3.生成 docker 映像并运行容器
- 4.进入容器并构建 Krita
1.前言
如果你是高级开发者,想要使用与 AppImage 相同的补丁依赖来构建 krita,本指南非常有用。如果你只是想破解 Krita,请阅读从源代码构建 Krita 指南。
Dockerfile 基于官方的 KDE 构建环境 ,与在 KDE CI 上用于构建官方 AppImage 包环境一致。本指南适用于基于 Ubuntu 和 Ubuntu 的 Linux 发行版。
2.安装配置docker
首先,确保已安装 Docker。
sudo apt install docker docker.io
确定要存储 Docker 映像的位置。默认情况下,所有 docker 映像和容器都存储在 /var 目录下的特殊 docker-daemon 控制文件夹中。你可能没有足够的空间来构建 Krita(它需要大约 10 GiB)。在这种情况下,建议移动 docker 镜像 文件夹复制到另一个位置,那里有足够的空间。
第一步,停止 docker 服务
sudo systemctl stop docker
第二步,编辑配置文件
在较新的系统上,如 Ubuntu 18.04 及更高版本,您需要打开文件 /etc/docker/daemon.json 并添加以下 json 配置选项:
{"data-root" : "/home/zhiliao/docker-data"
}
第三步,重启 docker 服务
sudo systemctl start docker
然后你需要下载 deps 和 Krita 源代码树。这些步骤不包含在 Dockerfile 中以节省内部带宽。
# create directory structure for container control directory
git clone https://invent.kde.org/dkazakov/krita-docker-env krita-auto-1cd krita-auto-1
mkdir persistent# copy/checkout Krita sources to 'persistent/krita'
cp -r /path/to/sources/krita ./persistent/krita## or ...
# git clone kde:krita persistent/krita# download the deps archive
./bin/bootstrap-deps.sh
3.生成 docker 映像并运行容器
./bin/build_image krita-deps
./bin/run_container krita-deps krita-auto-1
4.进入容器并构建 Krita
# enter the docker container (the name will be
# fetched automatically from '.container_name' file)./bin/enter
…现在您在容器内准备好了所有 deps …
# build Krita as usual
# you should be in ~/appimage-workspace/krita-build/
~/bin/run_cmake.sh ~/persistent/krita
make -j8 install# start Krita
/home/appimage/appimage-workspace/krita.appdir/usr/bin/krita
../appimage-workspace/krita.appdir/usr/bin/krita
这篇关于在linux上使用docker编译krita?的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!