jok*_*arl 1 debian dpkg alpine-linux
总体而言,我对 Linux 非常陌生,我正在尝试找到一种在 Alpine docker 映像上构建 Debian 软件包的方法。这是迄今为止我可以让管道运行的最快速度,但不幸的是,当我尝试运行时dpkg-deb --build
,出现以下错误:
03:22:44 dpkg-deb: building package 'x-sync' in 'x-sync_1.0.2.deb'.
03:22:44 tar: unrecognized option: format=gnu
03:22:44 BusyBox v1.27.2 (2018-01-29 15:48:57 GMT) multi-call binary.
03:22:44
03:22:44 Usage: tar -[cxtZzJjahmvO] [-X FILE] [-T FILE] [-f TARFILE] [-C DIR] [FILE]...
03:22:44
03:22:44 Create, extract, or list files from a tar file
03:22:44
03:22:44 Operation:
03:22:44 c Create
03:22:44 x Extract
03:22:44 t List
03:22:44 f Name of TARFILE ('-' for stdin/out)
03:22:44 C Change to DIR before operation
03:22:44 v Verbose
03:22:44 Z (De)compress using compress
03:22:44 z (De)compress using gzip
03:22:44 J (De)compress using xz
03:22:44 j (De)compress using bzip2
03:22:44 a (De)compress using lzma
03:22:44 O Extract to stdout
03:22:44 h Follow symlinks
03:22:44 m Don't restore mtime
03:22:44 exclude File to exclude
03:22:44 X File with names to exclude
03:22:44 T File with names to include
03:22:44 dpkg-deb: error: subprocess tar -cf returned error exit status 1
Run Code Online (Sandbox Code Playgroud)
我尝试在以下 Dockerfile 上打包:
FROM alpine
RUN apk add --no-cache dpkg openjdk8
Run Code Online (Sandbox Code Playgroud)
有没有办法在这个发行版上构建一个与其他发行版交叉兼容的 Debian 包,例如我的 Ubuntu 开发环境?
构建 Debian 软件包的最佳环境始终是基于 Debian 的环境。虽然基于 Alpine 的容器因其体积小和设置时间快而很好,但它们引入了许多问题,其中两个特别麻烦:
tar
您发现的);这两个都可以解决,但是当您这样做时,与最小的 Debian 容器(如bitnami/minideb
您提到的)相比,您已经失去了小型 Alpine 容器的优势。
请注意,如果您在开发和/或构建系统上运行 Debian 衍生版本,您可以完全跳过容器阶段,同时仍然使用包含的构建环境,通过使用pbuilder
. 要获得最大速度,请在 上安装 tmpfs /var/cache/pbuilder/build
,并使用eatmydata
. sbuild
并且cowbuilder
也值得研究,特别是如果您经常构建类似的包。
顺便说一句dpkg-deb -b
,我强烈建议学习如何构建源包,而不是使用 构建二进制包;从 Vincent Bernat实用的 Debian 包装开始,它既美观又简单。
归档时间: |
|
查看次数: |
3308 次 |
最近记录: |