在新推送的 docker 映像上安装一些红宝石时"cannot find -lucontext" 红宝石:2.7.4-高山3.13



我不能再在前一天推送的ruby:2.7.4-alpine3.13映像上安装Rubygemsbyebugracc了。好像有什么东西被移走了。

复制:

docker pull ruby:2.7.4-alpine3.13
2.7.4-alpine3.13: Pulling from library/ruby
Digest: sha256:89b589e1b6b334ed7af93da3d4c75dca5beef8f1a844594c3a865bc6c4f5b96e
Status: Image is up to date for ruby:2.7.4-alpine3.13
docker run --rm -it --entrypoint /bin/sh ruby@sha256:89b589e1b6b334ed7af93da3d4c75dca5beef8f1a844594c3a865bc6c4f5b96e
apk --no-cache add "build-base>=0.5"
gem install byebug

给我:

Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.

在日志下面,我得到:

current directory: /usr/local/bundle/gems/byebug-11.1.3/ext/byebug
/usr/local/bin/ruby -I /usr/local/lib/ruby/2.7.0 -r ./siteconf20211027-12-7c6k46.rb extconf.rb
creating Makefile
current directory: /usr/local/bundle/gems/byebug-11.1.3/ext/byebug
make "DESTDIR=" clean
current directory: /usr/local/bundle/gems/byebug-11.1.3/ext/byebug
make "DESTDIR="
compiling breakpoint.c
compiling byebug.c
compiling context.c
compiling locker.c
compiling threads.c
linking shared-object byebug/byebug.so
/usr/lib/gcc/x86_64-alpine-linux-musl/10.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -lucontext
collect2: error: ld returned 1 exit status
make: *** [Makefile:262: byebug.so] Error 1

查找头文件,我们得到:

find . -name ucontext.h
./usr/include/asm/ucontext.h
./usr/include/asm-generic/ucontext.h
./usr/include/sys/ucontext.h
./usr/include/ucontext.h

byebug gem的安装工作使用摘要来定义ruby:2.7.4-alpine3.13过去在2021年10月19日(ruby@sha256:ace3785b1a5eb95d08285f8741e3dc1c481c479a271d54e37b8e45a7106d86c6)的图像,但该图像在最后一天更新,并且其中有一些变化。

当我在工作映像上运行find . -name ucontext.h时,文件位于相同的位置。

有没有人对如何让它工作有任何想法?

我遇到了同样的问题。似乎是由这个提交引起的,我手动添加了libucontext-devAlpine包,并将命令export LIBS='-lucontext'包含到我的Dockerfile中,我的构建再次开始工作。

最新更新