linux - 如何在 Docker 容器中为 Alpine Linux 构建 APK?

标签 linux docker apk alpine-linux

我一直在尝试使用 Docker 容器和 abuild 工具为 Alpine 构建 APK 包。它给出了以下错误:

>>> hello: Building shared/hello 0.1.0-r0 (using abuild 3.8.0_rc4-r0) started Mon, 27 Sep 2021 13:44:06 +0000
>>> hello: Checking sanity of /shared/hello/APKBUILD...
>>> WARNING: hello: No maintainer
>>> hello: Analyzing dependencies...
>>> hello: Installing for build: build-base
WARNING: Ignoring /home/apk/packages//shared: No such file or directory
(1/1) Installing .makedepends-hello (20210927.134407)
OK: 280 MiB in 67 packages
>>> hello: Cleaning up srcdir
>>> hello: Cleaning up pkgdir
>>> hello: Checking sha512sums...
hello: OK
>>> hello: Entering fakeroot...
>>> hello*: Running postcheck for hello
find: /shared/hello/pkg/hello: No such file or directory
find: /shared/hello/pkg/hello: No such file or directory
find: /shared/hello/pkg/hello: No such file or directory
find: /shared/hello/pkg/hello: No such file or directory
find: /shared/hello/pkg/hello: No such file or directory
>>> hello*: Preparing package hello...
>>> ERROR: hello*: Missing /shared/hello/pkg/hello
>>> ERROR: hello: rootpkg failed
>>> hello: Uninstalling dependencies...
(1/1) Purging .makedepends-hello (20210927.134407)
OK: 280 MiB in 66 packages

我的 APKBUILD 看起来像:

pkgname="hello"
pkgver="0.1.0"
pkgrel="0"
pkgdesc="Hello World"
url="https://example.com"
arch="noarch"
license="COPYING"
source="../dst/hello"
depends=""

check() {
    :
}

package() {
    :
}

我已将 APKBUILD 文件放入它自己的名为“hello”的文件夹中,“hello”shellscript 位于一个名为“dst”的单独文件夹中。

最佳答案

我想通了:

这是对 APKBUILD 文件的一个非常简单的修复

pkgname="hello"
pkgver="0.1.0"
pkgrel="0"
pkgdesc="Hello World"
url="https://example.com"
arch="noarch"
license="COPYING"
source="../dst/hello"
depends=""

check() {
    :
}

package() {
    # Add this line to create the $pkgdir folder
    mkdir -p $pkgdir
}

关于linux - 如何在 Docker 容器中为 Alpine Linux 构建 APK?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69348064/

相关文章:

python - 我在 Django 中的 urls.py 中的 url 模式不匹配

linux - Bash Shell 脚本逐行读取文件

c - Linux/C 如何正确结束命令行程序

docker - 设置docker-compose环境变量以使用自定义java System.Property正确启动Jenkins

linux - 使用 inotify 处理预先存在的文件

docker - 典型的ElasticSearch/Logstash/Kibana部署模型是什么样的

docker - Deis Docker镜像部署

Android 安装 APK 时出错

android - 如何从 Android 应用程序访问 sysfs 条目

java - 如何在 apk 中列出所有 3rd 方 jar?