Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:

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”] 
like image 375
Ritika Avatar asked Feb 11 '21 12:02

Ritika


1 Answers

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

like image 197
Sai Krishna Avatar answered Nov 01 '22 21:11

Sai Krishna