简体   繁体   English

ArchLinux docker CI-未能初始化 alpm 库:: 返回非零代码:255

[英]ArchLinux docker CI-failed to initialise alpm library :: returned a non-zero code: 255

I am new to docker, I tried to create a custom image where i could simply run pacman -Syu --noconfirm but the following error occurred:我是 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

My dockerfile is:我的 dockerfile 是:

#This is a sample Image 
FROM archlinux

RUN pacman -Syu --noconfirm 
CMD [“echo”,”Image created”] 

This workaround has worked for me.这种解决方法对我有用。 It requires patching glibc to an older version.它需要将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 https://github.com/qutebrowser/qutebrowser/commit/478e4de7bd1f26bebdcdc166d5369b2b5142c3e2

Yeah looks like theres a problem with the glibc upgrade so pacman in docker isnt working on debian based systems是的,glibc 升级似乎有问题,所以 docker 中的 pacman 不能在基于 debian 的系统上工作

Theres a small hack ie you have to install runc package from apt有一个小技巧,即您必须从 apt 安装runc package

sudo apt-get install runc

Here's the bug report forum这是错误报告论坛

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM