ArchLinux docker CI 无法初始化 alpm 库 :: 返回非零代码:255 [英] ArchLinux docker CI-failed to initialise alpm library :: returned a non-zero code: 255

查看:52
本文介绍了ArchLinux docker CI 无法初始化 alpm 库 :: 返回非零代码:255的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 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 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

My dockerfile is :

#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.

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

这篇关于ArchLinux docker CI 无法初始化 alpm 库 :: 返回非零代码:255的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆