ruby / ruby/docker-images

Error when trying to build an image for ruby 2.5.9 with an arm64 arch

Open
#32 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
84
Forks
38
Avg merge
8h 13m
Merged PRs (30d)
2

Description

Hello,

I've got a problem when trying to build an image for ruby 2.5.9 with an arm64 arch with the focal version of Ubuntu.

I need a docker image for ruby 2.5.9 with a arm64 architecture working on a M1 processor from Apple (on macOS 12.1), but I've got this error:

rake --trace docker:build arch=arm64 ruby_version=2.5.9 ubuntu_version=focal
** Invoke docker:build (first_time)
** Execute docker:build
docker run --rm --privileged multiarch/qemu-user-static:register --reset
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
standard_init_linux.go:228: exec user process caused: exec format error
rake aborted!
Command failed with status (1): [docker run --rm --privileged multiarch/qem...]
/Users/alex/.gem/ruby/2.6.0/gems/rake-13.0.6/lib/rake/file_utils.rb:67:in `block in create_shell_runner'
/Users/alex/.gem/ruby/2.6.0/gems/rake-13.0.6/lib/rake/file_utils.rb:57:in `sh'
/Users/alex/git/ruby-docker-images/Rakefile:133:in `block (2 levels) in <top (required)>'
/Users/alex/.gem/ruby/2.6.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `block in execute'
/Users/alex/.gem/ruby/2.6.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `each'
/Users/alex/.gem/ruby/2.6.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `execute'
/Users/alex/.gem/ruby/2.6.0/gems/rake-13.0.6/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/monitor.rb:235:in `mon_synchronize'
/Users/alex/.gem/ruby/2.6.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
/Users/alex/.gem/ruby/2.6.0/gems/rake-13.0.6/lib/rake/task.rb:188:in `invoke'
/Users/alex/.gem/ruby/2.6.0/gems/rake-13.0.6/lib/rake/application.rb:160:in `invoke_task'
/Users/alex/.gem/ruby/2.6.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/Users/alex/.gem/ruby/2.6.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `each'
/Users/alex/.gem/ruby/2.6.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block in top_level'
/Users/alex/.gem/ruby/2.6.0/gems/rake-13.0.6/lib/rake/application.rb:125:in `run_with_threads'
/Users/alex/.gem/ruby/2.6.0/gems/rake-13.0.6/lib/rake/application.rb:110:in `top_level'
/Users/alex/.gem/ruby/2.6.0/gems/rake-13.0.6/lib/rake/application.rb:83:in `block in run'
/Users/alex/.gem/ruby/2.6.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
/Users/alex/.gem/ruby/2.6.0/gems/rake-13.0.6/lib/rake/application.rb:80:in `run'
/Users/alex/.gem/ruby/2.6.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/usr/bin/rake:23:in `load'
/usr/bin/rake:23:in `<main>'
Tasks: TOP => docker:build

Am I missing something ?

Thank you

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with Rakefile:133 and the reported docker:build command, especially the multiarch/qemu-user-static registration step. Reproduce the arm64 Ruby 2.5.9 build with Ubuntu focal and trace the exec format error; done means the requested image builds successfully without that failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, ruby, ubuntu
Domain
build-system, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.