docker-library / ruby

Docker Official Image packaging for Ruby
http://www.ruby-lang.org/
BSD 2-Clause "Simplified" License
590 stars 334 forks source link

v8 error when "bundle exec rake assets:precompile" in ruby:2.3.1-alpine #113

Closed monotek closed 6 years ago

monotek commented 7 years ago

I try to create a new docker image from ruby:2.3.1-alpine

This is my Dockerfile: https://github.com/monotek/zammad-docker-compose/blob/alpine/Dockerfile.zammad

When "bundle exec rake assets:precompile" from my install script is executed, i get the following error:

+ bundle exec rake assets:precompile
rake aborted!
LoadError: Error relocating /usr/local/bundle/gems/therubyracer-0.12.2/lib/v8/init.so: __vfprintf_chk: symbol not found - /usr/local/bundle/gems/therubyracer-0.12.2/lib/v8/init.so
/usr/local/bundle/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
/usr/local/bundle/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `block in require'
/usr/local/bundle/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency'
/usr/local/bundle/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
/usr/local/bundle/gems/therubyracer-0.12.2/lib/v8.rb:4:in `<top (required)>'
/usr/local/bundle/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
/usr/local/bundle/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `block in require'
/usr/local/bundle/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency'
/usr/local/bundle/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
/usr/local/bundle/gems/therubyracer-0.12.2/lib/therubyracer.rb:1:in `<top (required)>'
/home/zammad/config/application.rb:7:in `<top (required)>'
/home/zammad/Rakefile:5:in `require'
/home/zammad/Rakefile:5:in `<top (required)>'
/usr/local/bundle/gems/rake-11.2.2/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:22:in `load'
/usr/local/bin/bundle:22:in `<main>'
(See full trace by running task with --trace)
ERROR: Service 'zammad' failed to build: The command '/bin/sh -c chmod +x /tmp/install-zammad.sh;sleep 2;/bin/sh -l -c /tmp/install-zammad.sh' returned a non-zero code: 1

How can i fix this problem?

tianon commented 7 years ago

This looks to me like therubyracer may not support Alpine (yet?). See also https://github.com/cowboyd/therubyracer/issues/378#issuecomment-271606189, especially the reply:

The error you are experiencing is due to libv8 being linked against glibc and Alpine shipping only musl. The difficulty of running libv8 on Alpine is a known issue (https://github.com/cowboyd/libv8/#use-with-different-standard-c-libraries) that is still waiting for me (or preferably a kind contributor) to spend some time on (see cowboyd/libv8#221).

monotek commented 7 years ago

Thanks for the info,. Switched to ruby:2.3.1-slim.

tianon commented 6 years ago

Closing, given that there's nothing actionable for us here.