Skip to content

Docker build fails #82

Description

@DavidBiesack

I've cloned this repo in GitHub to create a PR to register a specification extension. As per CONTRIBUTING.md I tried to launch Docker to build the server locally, but I get build resolution errors with Jekyll/Ruby/Gems:

# docker run -p 4000:4000 -v $(pwd):/site bretfisher/jekyll-serve
docker run -p 4000:4000 -v $(pwd):/site bretfisher/jekyll-serve
Unable to find image 'bretfisher/jekyll-serve:latest' locally
latest: Pulling from bretfisher/jekyll-serve

Digest: sha256:4577540b370ef990818075fd1b378405961b6806c1552c268f4e914c16af3a8a
Status: Downloaded newer image for bretfisher/jekyll-serve:latest
Bundler 4.0.10 is running, but your lockfile was generated with 2.5.10. Installing Bundler 2.5.10 and restarting using that version.
Fetching gem metadata from https://rubygems.org/.
Fetching bundler 2.5.10
Installing bundler 2.5.10
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Could not find compatible versions

Because github-pages >= 232 depends on jekyll-commonmark-ghpages = 0.5.1
  and jekyll-commonmark-ghpages >= 0.2.0 depends on jekyll-commonmark ~> 1.4.0,
  github-pages >= 232 requires jekyll-commonmark ~> 1.4.0.
And because jekyll-commonmark >= 1.4.0 depends on commonmarker ~> 0.22
  and commonmarker >= 0.22.0, < 1.0.0.pre depends on Ruby >= 2.6, < 4.0,
  github-pages >= 232 requires Ruby >= 2.6, < 4.0.
So, because Gemfile depends on github-pages ~> 232
  and current Ruby version is = 4.0.1,
  version solving has failed.

What's next:
    Debug this container error with Gordon → docker ai "help me fix this container error"

I'm on MacOS (Apple M4 silicon) with Docker

# docker --version
Docker version 29.5.3, build d1c06efc

I was able to get around the above problem by using a newer github-pages

# git diff Gemfile
diff --git a/Gemfile b/Gemfile
index ac606b4..70c7e49 100644
--- a/Gemfile
+++ b/Gemfile
@@ -5,7 +5,7 @@ source "https://rubygems.org"
 # gem "jekyll", "~> 4.4"
 # If you want to use GitHub Pages, remove the "gem "jekyll"" above and
 # uncomment the line below. To upgrade, run `bundle update github-pages`.
-gem "github-pages", "~> 232", group: :jekyll_plugins
+gem "github-pages", group: :jekyll_plugins
 gem "webrick", "~> 1.9"
 gem "jekyll-remote-theme"
 gem "jekyll-include-cache", "~>0.2.1"

but now I received another error

# docker run -p 4000:4000 -v $(pwd):/site bretfisher/jekyll-serve
...
/usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll.rb:28: warning: csv used to be loaded from the standard library, but is not part of the default gems since Ruby 3.4.0.
You can add csv to your Gemfile or gemspec to fix this error.
bundler: failed to load command: jekyll (/usr/local/bundle/bin/jekyll)
/usr/local/lib/ruby/4.0.0/bundled_gems.rb:60:in 'Kernel.require': cannot load such file -- csv (LoadError)
	from /usr/local/lib/ruby/4.0.0/bundled_gems.rb:60:in 'block (2 levels) in Kernel#replace_require'
	from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll.rb:28:in '<top (required)>'
	from /usr/local/lib/ruby/4.0.0/bundled_gems.rb:60:in 'Kernel.require'
	from /usr/local/lib/ruby/4.0.0/bundled_gems.rb:60:in 'block (2 levels) in Kernel#replace_require'
	from /usr/local/bundle/gems/jekyll-3.9.0/exe/jekyll:8:in '<top (required)>'
	from /usr/local/lib/ruby/site_ruby/4.0.0/rubygems.rb:305:in 'Kernel#load'
	from /usr/local/lib/ruby/site_ruby/4.0.0/rubygems.rb:305:in 'Gem.activate_and_load_bin_path'
	from /usr/local/bundle/bin/jekyll:25:in '<top (required)>'
	from /usr/local/bundle/gems/bundler-2.5.10/lib/bundler/cli/exec.rb:58:in 'Kernel.load'
	from /usr/local/bundle/gems/bundler-2.5.10/lib/bundler/cli/exec.rb:58:in 'Bundler::CLI::Exec#kernel_load'
	from /usr/local/bundle/gems/bundler-2.5.10/lib/bundler/cli/exec.rb:23:in 'Bundler::CLI::Exec#run'
	from /usr/local/bundle/gems/bundler-2.5.10/lib/bundler/cli.rb:455:in 'Bundler::CLI#exec'
	from /usr/local/bundle/gems/bundler-2.5.10/lib/bundler/vendor/thor/lib/thor/command.rb:28:in 'Bundler::Thor::Command#run'
	from /usr/local/bundle/gems/bundler-2.5.10/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in 'Bundler::Thor::Invocation#invoke_command'
	from /usr/local/bundle/gems/bundler-2.5.10/lib/bundler/vendor/thor/lib/thor.rb:527:in 'Bundler::Thor.dispatch'
	from /usr/local/bundle/gems/bundler-2.5.10/lib/bundler/cli.rb:35:in 'Bundler::CLI.dispatch'
	from /usr/local/bundle/gems/bundler-2.5.10/lib/bundler/vendor/thor/lib/thor/base.rb:584:in 'Bundler::Thor::Base::ClassMethods#start'
	from /usr/local/bundle/gems/bundler-2.5.10/lib/bundler/cli.rb:29:in 'Bundler::CLI.start'
	from /usr/local/bundle/gems/bundler-2.5.10/exe/bundle:28:in 'block in <top (required)>'
	from /usr/local/bundle/gems/bundler-2.5.10/lib/bundler/friendly_errors.rb:117:in 'Bundler.with_friendly_errors'
	from /usr/local/bundle/gems/bundler-2.5.10/exe/bundle:20:in '<top (required)>'
	from /usr/local/lib/ruby/site_ruby/4.0.0/rubygems.rb:305:in 'Kernel#load'
	from /usr/local/lib/ruby/site_ruby/4.0.0/rubygems.rb:305:in 'Gem.activate_and_load_bin_path'
	from /usr/local/bin/bundle:25:in '<main>'

What's next:
    Debug this container error with Gordon → docker ai "help me fix this container error"

I tried to add csv gem to Gemfile but then I get yet another error

/usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/log_adapter.rb:43: warning: Logger not initialized properly
/usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/stevenson.rb:5: info: Jekyll::Stevenson#initialize: does not call super probably
Configuration file: /site/_config.yml
To use retry middleware with Faraday v2.0+, install `faraday-retry` gem
            Source: /site
       Destination: /site/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
      Remote Theme: Using theme just-the-docs/just-the-docs
  Liquid Exception: undefined method 'tainted?' for an instance of String in /site/registries/_format/base64url.md
jekyll 3.9.0 | Error:  undefined method 'tainted?' for an instance of String
/usr/local/bundle/gems/liquid-4.0.3/lib/liquid/variable.rb:124:in 'Liquid::Variable#taint_check': undefined method 'tainted?' for an instance of String (NoMethodError)

      return unless obj.tainted?
                       ^^^^^^^^^
	from /usr/local/bundle/gems/liquid-4.0.3/lib/liquid/variable.rb:89:in 'Liquid::Variable#render'
	from /usr/local/bundle/gems/liquid-4.0.3/lib/liquid/block_body.rb:103:in 'Liquid::BlockBody#render_node_to_output'
	from /usr/local/bundle/gems/liquid-4.0.3/lib/liquid/block_body.rb:80:in 'Liquid::BlockBody#render'
	from /usr/local/bundle/gems/liquid-4.0.3/lib/liquid/block.rb:17:in 'Liquid::Block#render'
	from /usr/local/bundle/gems/liquid-4.0.3/lib/liquid/tags/capture.rb:26:in 'Liquid::Capture#render'
	from /usr/local/bundle/gems/liquid-4.0.3/lib/liquid/block_body.rb:103:in 'Liquid::BlockBody#render_node_to_output'
	from /usr/local/bundle/gems/liquid-4.0.3/lib/liquid/block_body.rb:82:in 'Liquid::BlockBody#render'
	from /usr/local/bundle/gems/liquid-4.0.3/lib/liquid/template.rb:208:in 'block in Liquid::Template#render'
	from /usr/local/bundle/gems/liquid-4.0.3/lib/liquid/template.rb:242:in 'Liquid::Template#with_profiling'
	from /usr/local/bundle/gems/liquid-4.0.3/lib/liquid/template.rb:207:in 'Liquid::Template#render'
	from /usr/local/bundle/gems/liquid-4.0.3/lib/liquid/template.rb:220:in 'Liquid::Template#render!'
	from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/liquid_renderer/file.rb:30:in 'block (2 levels) in Jekyll::LiquidRenderer::File#render!'
	from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/liquid_renderer/file.rb:42:in 'Jekyll::LiquidRenderer::File#measure_bytes'
	from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/liquid_renderer/file.rb:29:in 'block in Jekyll::LiquidRenderer::File#render!'
	from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/liquid_renderer/file.rb:49:in 'Jekyll::LiquidRenderer::File#measure_time'
	from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/liquid_renderer/file.rb:28:in 'Jekyll::LiquidRenderer::File#render!'
	from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/renderer.rb:126:in 'Jekyll::Renderer#render_liquid'
	from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/renderer.rb:79:in 'Jekyll::Renderer#render_document'
	from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/renderer.rb:62:in 'Jekyll::Renderer#run'
	from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/site.rb:479:in 'Jekyll::Site#render_regenerated'
	from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/site.rb:464:in 'block (2 levels) in Jekyll::Site#render_docs'
	from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/site.rb:463:in 'Array#each'
	from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/site.rb:463:in 'block in Jekyll::Site#render_docs'
	from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/site.rb:462:in 'Hash#each_value'
	from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/site.rb:462:in 'Jekyll::Site#render_docs'
	from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/site.rb:191:in 'Jekyll::Site#render'
	from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/site.rb:71:in 'Jekyll::Site#process'
	from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/command.rb:28:in 'Jekyll::Command.process_site'
	from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/commands/build.rb:65:in 'Jekyll::Commands::Build.build'
	from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/commands/build.rb:36:in 'Jekyll::Commands::Build.process'
	from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:93:in 'block in Jekyll::Commands::Serve.start'
	from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:93:in 'Array#each'
	from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:93:in 'Jekyll::Commands::Serve.start'
	from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:75:in 'block (2 levels) in Jekyll::Commands::Serve.init_with_program'
	from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in 'block in Mercenary::Command#execute'
	from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in 'Array#each'
	from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in 'Mercenary::Command#execute'
	from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in 'Mercenary::Program#go'
	from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary.rb:19:in 'Mercenary.program'
	from /usr/local/bundle/gems/jekyll-3.9.0/exe/jekyll:15:in '<top (required)>'
	from /usr/local/lib/ruby/site_ruby/4.0.0/rubygems.rb:305:in 'Kernel#load'
	from /usr/local/lib/ruby/site_ruby/4.0.0/rubygems.rb:305:in 'Gem.activate_and_load_bin_path'
	from /usr/local/bundle/bin/jekyll:25:in '<top (required)>'
	from /usr/local/bundle/gems/bundler-2.5.10/lib/bundler/cli/exec.rb:58:in 'Kernel.load'
	from /usr/local/bundle/gems/bundler-2.5.10/lib/bundler/cli/exec.rb:58:in 'Bundler::CLI::Exec#kernel_load'
	from /usr/local/bundle/gems/bundler-2.5.10/lib/bundler/cli/exec.rb:23:in 'Bundler::CLI::Exec#run'
	from /usr/local/bundle/gems/bundler-2.5.10/lib/bundler/cli.rb:455:in 'Bundler::CLI#exec'
	from /usr/local/bundle/gems/bundler-2.5.10/lib/bundler/vendor/thor/lib/thor/command.rb:28:in 'Bundler::Thor::Command#run'
	from /usr/local/bundle/gems/bundler-2.5.10/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in 'Bundler::Thor::Invocation#invoke_command'
	from /usr/local/bundle/gems/bundler-2.5.10/lib/bundler/vendor/thor/lib/thor.rb:527:in 'Bundler::Thor.dispatch'
	from /usr/local/bundle/gems/bundler-2.5.10/lib/bundler/cli.rb:35:in 'Bundler::CLI.dispatch'
	from /usr/local/bundle/gems/bundler-2.5.10/lib/bundler/vendor/thor/lib/thor/base.rb:584:in 'Bundler::Thor::Base::ClassMethods#start'
	from /usr/local/bundle/gems/bundler-2.5.10/lib/bundler/cli.rb:29:in 'Bundler::CLI.start'
	from /usr/local/bundle/gems/bundler-2.5.10/exe/bundle:28:in 'block in <top (required)>'
	from /usr/local/bundle/gems/bundler-2.5.10/lib/bundler/friendly_errors.rb:117:in 'Bundler.with_friendly_errors'
	from /usr/local/bundle/gems/bundler-2.5.10/exe/bundle:20:in '<top (required)>'
	from /usr/local/lib/ruby/site_ruby/4.0.0/rubygems.rb:305:in 'Kernel#load'
	from /usr/local/lib/ruby/site_ruby/4.0.0/rubygems.rb:305:in 'Gem.activate_and_load_bin_path'
	from /usr/local/bin/bundle:25:in '<main>'

What's next:
    Debug this container error with Gordon → docker ai "help me fix this container error"

Has anyone who has worked with this repo recently got the Docker Jekyll image to work correctly?

I tried the docker ai command, which recommended:

The error is clear: Jekyll 3.9.0 with Liquid 4.0.3 running on Ruby 4.0 fails because Ruby 4.0 removed the tainted? method.
This is a compatibility issue between old Jekyll/Liquid versions and new Ruby versions.

The problem: The bretfisher/jekyll-serve image contains outdated gems that are incompatible with newer Ruby versions. The
Liquid gem is calling tainted? on a String, which doesn't exist in Ruby 4.0.

The fix: You need to either:

- Use an older Ruby version (Ruby 2.7–3.x)
- Update to newer Jekyll/Liquid versions that support Ruby 4.0

The easiest solution is to use a Jekyll image pinned to an older Ruby version. Try running the container with a specific tag:

docker run -it --rm -v $(pwd):/site bretfisher/jekyll-serve:latest-3.8.7


Or rebuild by checking if there's a newer bretfisher/jekyll-serve image available with Ruby 3.x support. If the issue
persists, you'll need a custom Dockerfile that updates Jekyll, Liquid, and related gems to versions compatible with Ruby 4.0.

Which approach fits your workflow—pinning to older Ruby, or updating the gems?

but of course bretfisher/jekyll-serve:latest-3.8.7 does not exist...

and I thought the entire point of Docker images was that they had all the correct versions installed.... :-(

I reported this via BretFisher/jekyll-serve#99 but it could be a problem with some other dependency based on the Gemfile in this repo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions