[Topic discussion] 玲珑包命令路径 Resolved
Tofloor
poster avatar
王多鱼
deepin
2024-06-12 12:18
Author

https://www.deepin.org/zh/building-linglong-format-applications-from-source-code/

理解安装位置“前缀”

以我们所熟知的方式来理解,一般可执行文件需要放到 /usr/bin 文件夹下,在终端尝试执行时才能被找到;.desktop 文件提供了启动的入口,想在启动器中看到应用图标,一般放到 /usr/share/applications 文件夹下;而图片文件会放到 /usr/share/icons 文件夹中具体的图标主题及尺寸和分类文件夹下。这其中,/usr 就是所有文件安装位置的 前缀

根据 GNU 编码标准前缀 的默认值一般为 /usr/local;而构建 deb 格式软件包时,一般会使用 /usr 前缀。

而玲珑容器启动时,会将容器内容 files 文件夹 挂载至 /opt/apps/${appid} 文件夹下,故可以近似认为 前缀/opt/apps/${appid}/files。以此类推,可执行文件的实际位置为 /opt/apps/${appid}/files/bin/可执行文件名称,所以 linglong.yamlcommand 启动指令部分也需要如此填写,而不是常见的 /usr/bin/可执行文件名称

这里的路径为什么不能是容器内相对路径呢?

既然都用到容器了,为什么还要关心容器外什么路径呢?

路径拼接不能由主机运行时来解决吗?

类似docker entrypoint 和docker run 那样。

Reply Favorite View the author
All Replies
neko
deepin
Ecological co-builder
2024-06-12 12:33
#1

可以用相对路径,见

https://bbs.deepin.org/post/273004

Reply View the author
神末shenmo
deepin
Spark-App
2024-06-12 12:47
#2
neko

可以用相对路径,见

https://bbs.deepin.org/post/273004

我想他的意思是,为什么不把这个目录加到PATH里面

Reply View the author
neko
deepin
Ecological co-builder
2024-06-12 12:48
#3
神末shenmo

我想他的意思是,为什么不把这个目录加到PATH里面

虽然但是,这个目录本来就在PATH环境变量emm

Reply View the author
神末shenmo
deepin
Spark-App
2024-06-12 12:49
#4
neko

虽然但是,这个目录本来就在PATH环境变量emm

那应该不用前缀就直接运行呗

Reply View the author
王多鱼
deepin
2024-06-12 13:31
#5
neko

可以用相对路径,见

https://bbs.deepin.org/post/273004

谁写的文章,

应该推荐使用相对路径。。。。

Reply View the author
neko
deepin
Ecological co-builder
2024-06-12 13:35
#6
王多鱼

谁写的文章,

应该推荐使用相对路径。。。。

本来就是用的相对路径哦

image.png

Reply View the author
王多鱼
deepin
2024-06-12 13:54
#7
neko

本来就是用的相对路径哦

image.png

链接里那篇文章用的是绝对路径,而且还在解释半天。。。

Reply View the author
王多鱼
deepin
2024-06-12 14:01
#8

理论上应该禁止绝对路径。。。

安装路径也不一定是 /opt/apps

Reply View the author
👿Deepin大护法👿
deepin
2024-06-13 11:50
#9

hey, 专业答疑请移步

https://github.com/orgs/linuxdeepin/discussions

https://github.com/linuxdeepin/linglong

Reply View the author