我是新的docker,我试图创建一个自定义图像,我可以简单地运行pacman -Syu --noconfirm
,但发生以下错误:
error: failed to initialize alpm library
(could not find or read directory: /var/lib/pacman/)
The command '/bin/sh -c pacman -Syu --noconfirm' returned a non-zero code: 255
我的dockerfile是:
#This is a sample Image
FROM archlinux
RUN pacman -Syu --noconfirm
CMD [“echo”,”Image created”]
这个方法对我很有效。它需要修补glibc到旧版本
RUN patched_glibc=glibc-linux4-2.33-4-x86_64.pkg.tar.zst &&
curl -LO "https://repo.archlinuxcn.org/x86_64/$patched_glibc" &&
bsdtar -C / -xvf "$patched_glibc"
https://github.com/qutebrowser/qutebrowser/commit/478e4de7bd1f26bebdcdc166d5369b2b5142c3e2