问题描述
我是 docker 新手,我尝试创建一个自定义映像,我可以在其中简单地运行 pacman -Syu --noconfirm
但出现以下错误:
错误:初始化alpm库失败(无法找到或读取目录:/var/lib/pacman/)命令/bin/sh -c pacman -Syu --noconfirm"返回非零代码:255
我的 dockerfile 是:
#这是一个示例图片来自 archlinux运行 pacman -Syu --noconfirmCMD [回声",图像创建"]
此解决方法对我有用.它需要将 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/qutebrowser/commit/462bdc162bdc162bdc166d5369bdc166bdc162bdc16bdc168dc178dc/p> I am new to docker , I tried to create a custom image where i could simply run My dockerfile is : This workaround has worked for me. It requires patching glibc to an older version. https://github.com/qutebrowser/qutebrowser/commit/478e4de7bd1f26bebdcdc166d5369b2b5142c3e2 这篇关于ArchLinux docker CI 无法初始化 alpm 库 :: 返回非零代码:255的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!pacman -Syu --noconfirm
but the following error occurred: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
#This is a sample Image
FROM archlinux
RUN pacman -Syu --noconfirm
CMD ["echo","Image created"]
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"