ruby - 在新推送的 docker image ruby:2.7.4-alpine3.13 上安装一些 rubygems 时“找不到 -lucontext”
问题描述
我无法再安装 Rubygemsbyebug
和最后一天推送racc
的图像。ruby:2.7.4-alpine3.13
似乎某些东西已被删除或移动。
重现:
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-dev
Alpine 包并将命令包含export LIBS='-lucontext'
到我的 Dockerfile 中,并且我的构建再次开始工作。
推荐阅读
- amazon-web-services - 无法在 cloudformation 中创建简单的存储桶
- python - 我正在尝试生成谢尔宾斯基三角形的输出。我想知道如何使用 2d 点类中的 midpt 函数来实现此输出?
- python - 如何访问n叉树中节点的父节点?
- c# - 在 .net 核心中找不到 ILogger 类
- python - 代码在函数之外工作,但不在函数内部
- javascript - 路由包含在不同文件中时未定义猫鼬模式
- dart - 我的变量会自动更新......当我只设置一次时。为什么会这样?
- json - 从 Oracle 表中的 CLOB 数据类型字段中提取文本
- c# - 如何在数据绑定值更改时更新图像?
- android - ReclycleView 具有分组数据和横向和纵向模式的响应标题