[error] root@taishan200-2280-2s64p-256g--a7 /c/compass-ci/container/fluentd-base# ./build ... ERROR: Error installing async: ERROR: Failed to build gem native extension. current directory: /usr/lib/ruby/gems/2.6.0/gems/nio4r-2.5.5/ext/nio4r /usr/bin/ruby -I /usr/lib/ruby/2.6.0 -r ./siteconf20210222-482-mws95t.rb extconf.rb checking for unistd.h... yes checking for linux/aio_abi.h... no checking for linux/io_uring.h... no checking for sys/select.h... yes checking for port_event_t in poll.h... no checking for sys/epoll.h... yes checking for sys/event.h... no checking for port_event_t in port.h... no checking for sys/resource.h... yes creating Makefile current directory: /usr/lib/ruby/gems/2.6.0/gems/nio4r-2.5.5/ext/nio4r make "DESTDIR=" clean current directory: /usr/lib/ruby/gems/2.6.0/gems/nio4r-2.5.5/ext/nio4r make "DESTDIR=" compiling bytebuffer.c compiling monitor.c compiling nio4r_ext.c In file included from nio4r_ext.c:6: ../libev/ev.c:479:11: fatal error: linux/version.h: No such file or directory 479 | # include <linux/version.h> | ^~~~~~~~~~~~~~~~~ compilation terminated. make: *** [Makefile:245: nio4r_ext.o] Error 1 make failed, exit code 2 Gem files will remain installed in /usr/lib/ruby/gems/2.6.0/gems/nio4r-2.5.5 for inspection. Results logged to /usr/lib/ruby/gems/2.6.0/extensions/aarch64-linux/2.6.0/nio4r-2.5.5/gem_make.out The command '/bin/sh -c umask 002 && gem sources -r https://rubygems.org/ -a https://gems.ruby-china.com/ && gem install fluentd && gem install fluent-plugin-rabbitmq && gem install fluent-plugin-elasticsearch && gem install fluent-plugin-tail-ex && gem install fluent-plugin-tail-multiline && gem install json && gem install async && gem install webrick && gem install io-console && gem install etc' returned a non-zero code: 1
[how] 'gem install async' in Dockerfile cause error, apk add linux-headers can fix it.
Signed-off-by: Liu Yinsi liuyinsi@163.com --- container/fluentd-base/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/container/fluentd-base/Dockerfile b/container/fluentd-base/Dockerfile index 08bcd9c..2d181f5 100644 --- a/container/fluentd-base/Dockerfile +++ b/container/fluentd-base/Dockerfile @@ -10,7 +10,7 @@ RUN sed -ri.origin 's|^https?://dl-cdn.alpinelinux.org|http://mirrors.huaweiclou RUN apk update
RUN apk add --no-cache 'ruby-dev' \ - 'g++' 'gcc' 'pcre' 'libevent' 'make' 'git' 'cpio' 'bash' + 'g++' 'gcc' 'pcre' 'libevent' 'make' 'git' 'cpio' 'bash' 'linux-headers'
RUN umask 002 && \ gem sources -r https://rubygems.org/ -a https://gems.ruby-china.com/ && \