Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker; ruby 3.2.4 or 2.7.7? #499

Open
JPHutchins opened this issue Jul 31, 2024 · 1 comment
Open

Docker; ruby 3.2.4 or 2.7.7? #499

JPHutchins opened this issue Jul 31, 2024 · 1 comment

Comments

@JPHutchins
Copy link
Contributor

JPHutchins commented Jul 31, 2024

I built the website manually, and that was OK. When trying to use docker I get

docker run --rm -i -t --publish=4000:4000 --volume ${PWD}:/memfault/interrupt memfault/interrupt
Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
Configuration file: /memfault/interrupt/_config.yml
            Source: /memfault/interrupt
       Destination: /memfault/interrupt/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
              Lunr: Search index generation disabled. Enable by setting 'GENERATE_SEARCH_INDEX=true' environment variable.
  Liquid Exception: undefined method `tainted?' for {"name"=>"François Baldassari", "email"=>"francois@memfault.com", "web"=>"https://twitter.com/baldassarifr", "image"=>"/img/author/francois.jpg", "blurb"=>"has worked on the embedded software teams at Sun, Pebble, and Oculus. He is currently the CEO of <a href='https://memfault.com'>Memfault</a>.", "twitter"=>"baldassarifr", "linkedin"=>"https://www.linkedin.com/in/francois-baldassari", "github"=>"franc0is"}:Hash in /memfault/interrupt/_layouts/post.html
bundler: failed to load command: jekyll (/usr/local/bundle/bin/jekyll)
/usr/local/bundle/gems/liquid-4.0.3/lib/liquid/variable.rb:124:in `taint_check': undefined method `tainted?' for {"name"=>"François Baldassari", "email"=>"francois@memfault.com", "web"=>"https://twitter.com/baldassarifr", "image"=>"/img/author/francois.jpg", "blurb"=>"has worked on the embedded software teams at Sun, Pebble, and Oculus. He is currently the CEO of <a href='https://memfault.com'>Memfault</a>.", "twitter"=>"baldassarifr", "linkedin"=>"https://www.linkedin.com/in/francois-baldassari", "github"=>"franc0is"}:Hash (NoMethodError)

      return unless obj.tainted?
                       ^^^^^^^^^
        from /usr/local/bundle/gems/liquid-4.0.3/lib/liquid/variable.rb:89:in `render'
        from /usr/local/bundle/gems/liquid-4.0.3/lib/liquid/tags/assign.rb:26:in `render'
        from /usr/local/bundle/gems/liquid-4.0.3/lib/liquid/block_body.rb:103:in `render_node_to_output'
        from /usr/local/bundle/gems/liquid-4.0.3/lib/liquid/block_body.rb:91:in `render'
        from /usr/local/bundle/gems/liquid-4.0.3/lib/liquid/template.rb:208:in `block in render'
        from /usr/local/bundle/gems/liquid-4.0.3/lib/liquid/template.rb:242:in `with_profiling'
        from /usr/local/bundle/gems/liquid-4.0.3/lib/liquid/template.rb:207:in `render'
        from /usr/local/bundle/gems/liquid-4.0.3/lib/liquid/template.rb:220:in `render!'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/liquid_renderer/file.rb:39:in `block (3 levels) in render!'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/liquid_renderer/file.rb:59:in `measure_counts'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/liquid_renderer/file.rb:38:in `block (2 levels) in render!'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/liquid_renderer/file.rb:63:in `measure_bytes'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/liquid_renderer/file.rb:37:in `block in render!'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/liquid_renderer/file.rb:70:in `measure_time'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/liquid_renderer/file.rb:36:in `render!'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/renderer.rb:131:in `render_liquid'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/renderer.rb:194:in `render_layout'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/renderer.rb:163:in `place_in_layouts'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/renderer.rb:93:in `render_document'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/renderer.rb:63:in `run'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/site.rb:547:in `render_regenerated'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/site.rb:532:in `block (2 levels) in render_docs'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/site.rb:531:in `each'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/site.rb:531:in `block in render_docs'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/site.rb:530:in `each_value'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/site.rb:530:in `render_docs'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/site.rb:210:in `render'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/site.rb:80:in `process'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/command.rb:28:in `process_site'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/commands/build.rb:65:in `build'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/commands/build.rb:36:in `process'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/command.rb:91:in `block in process_with_graceful_fail'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/command.rb:91:in `each'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/command.rb:91:in `process_with_graceful_fail'
        from /usr/local/bundle/gems/jekyll-4.2.1/lib/jekyll/commands/serve.rb:86:in `block (2 levels) in init_with_program'
        from /usr/local/bundle/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
        from /usr/local/bundle/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
        from /usr/local/bundle/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
        from /usr/local/bundle/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
        from /usr/local/bundle/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
        from /usr/local/bundle/gems/jekyll-4.2.1/exe/jekyll:15:in `<top (required)>'
        from /usr/local/bundle/bin/jekyll:25:in `load'
        from /usr/local/bundle/bin/jekyll:25:in `<top (required)>'
        from /usr/local/bundle/gems/bundler-2.2.29/lib/bundler/cli/exec.rb:58:in `load'
        from /usr/local/bundle/gems/bundler-2.2.29/lib/bundler/cli/exec.rb:58:in `kernel_load'
        from /usr/local/bundle/gems/bundler-2.2.29/lib/bundler/cli/exec.rb:23:in `run'
        from /usr/local/bundle/gems/bundler-2.2.29/lib/bundler/cli.rb:478:in `exec'
        from /usr/local/bundle/gems/bundler-2.2.29/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
        from /usr/local/bundle/gems/bundler-2.2.29/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
        from /usr/local/bundle/gems/bundler-2.2.29/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
        from /usr/local/bundle/gems/bundler-2.2.29/lib/bundler/cli.rb:31:in `dispatch'
        from /usr/local/bundle/gems/bundler-2.2.29/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
        from /usr/local/bundle/gems/bundler-2.2.29/lib/bundler/cli.rb:25:in `start'
        from /usr/local/bundle/gems/bundler-2.2.29/exe/bundle:49:in `block in <top (required)>'
        from /usr/local/bundle/gems/bundler-2.2.29/lib/bundler/friendly_errors.rb:128:in `with_friendly_errors'
        from /usr/local/bundle/gems/bundler-2.2.29/exe/bundle:37:in `<top (required)>'
        from /usr/local/bundle/bin/bundle:25:in `load'
        from /usr/local/bundle/bin/bundle:25:in `<main>'

Which I recognized from before when I ignored the ruby==2.7.7 requirement during manual install.

Docker seems to include Ruby 3.2.4

docker build -t memfault/interrupt .
[+] Building 0.5s (15/15) FINISHED                                         docker:desktop-linux
 => [internal] load build definition from Dockerfile                                       0.0s
 => => transferring dockerfile: 628B                                                       0.0s
 => [internal] load metadata for docker.io/library/ruby:3.2.4-slim-bookworm                0.4s
 => [internal] load .dockerignore                                                          0.0s
 => => transferring context: 69B                                                           0.0s
 => [ 1/10] FROM docker.io/library/ruby:3.2.4-slim-bookworm@sha256:3e345863daec6349230144  0.0s
 => [internal] load build context                                                          0.0s
 => => transferring context: 128B                                                          0.0s
 => CACHED [ 2/10] RUN apt-get update && apt-get install -y --no-install-recommends     b  0.0s
 => CACHED [ 3/10] WORKDIR /memfault/interrupt                                             0.0s
 => CACHED [ 4/10] COPY Gemfile .                                                          0.0s
 => CACHED [ 5/10] COPY Gemfile.lock .                                                     0.0s
 => CACHED [ 6/10] RUN bundle config force_ruby_platform true                              0.0s
 => CACHED [ 7/10] RUN bundle install                                                      0.0s
 => CACHED [ 8/10] COPY requirements.txt .                                                 0.0s
 => CACHED [ 9/10] RUN python3 -m venv /venv && . /venv/bin/activate &&     python3 -m pi  0.0s
 => CACHED [10/10] COPY entrypoint.sh ./entrypoint.sh                                      0.0s
 => exporting to image                                                                     0.0s
 => => exporting layers                                                                    0.0s
 => => writing image sha256:925bd677ba7d920a641edfc36bafbd2fb2546926fe298bbbca3ac84d88139  0.0s
 => => naming to docker.io/memfault/interrupt                                              0.0s

View build details: docker-desktop://dashboard/build/desktop-linux/desktop-linux/oqxko25uiuhznxoem93a5ibv7
@JPHutchins JPHutchins changed the title Docker; ruby 3.2.4 or 2.7.7 Docker; ruby 3.2.4 or 2.7.7? Jul 31, 2024
@JPHutchins
Copy link
Contributor Author

This is fixed by updating the Dockerfile:

FROM ruby:2.7.7-slim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant