Skip to content

mcr.microsoft.com/devcontainers/jekyll:0.1.18 doesn't work when Gemfile.lock is present #385

@tudortimi

Description

@tudortimi

I have a Jekyll project with a Gemfile.lock. If I try to use version 0.1.18 of the image, the container fails during the post create command.

Here's a devcontainer,json

{
	"name": "Jekyll",
	"image": "mcr.microsoft.com/devcontainers/jekyll:0.1.18-2.7-bullseye"
}

and a Gemfile.lock

GEM
  remote: https://rubygems.org/
  specs:
    addressable (2.8.0)
      public_suffix (>= 2.0.2, < 5.0)
    colorator (1.1.0)
    concurrent-ruby (1.1.9)
    em-websocket (0.5.2)
      eventmachine (>= 0.12.9)
      http_parser.rb (~> 0.6.0)
    eventmachine (1.2.7)
    faraday (1.8.0)
      faraday-em_http (~> 1.0)
      faraday-em_synchrony (~> 1.0)
      faraday-excon (~> 1.1)
      faraday-httpclient (~> 1.0.1)
      faraday-net_http (~> 1.0)
      faraday-net_http_persistent (~> 1.1)
      faraday-patron (~> 1.0)
      faraday-rack (~> 1.0)
      multipart-post (>= 1.2, < 3)
      ruby2_keywords (>= 0.0.4)
    faraday-em_http (1.0.0)
    faraday-em_synchrony (1.0.0)
    faraday-excon (1.1.0)
    faraday-httpclient (1.0.1)
    faraday-net_http (1.0.1)
    faraday-net_http_persistent (1.2.0)
    faraday-patron (1.0.0)
    faraday-rack (1.0.0)
    ffi (1.15.4)
    forwardable-extended (2.6.0)
    http_parser.rb (0.6.0)
    i18n (1.8.11)
      concurrent-ruby (~> 1.0)
    jekyll (4.2.1)
      addressable (~> 2.4)
      colorator (~> 1.0)
      em-websocket (~> 0.5)
      i18n (~> 1.0)
      jekyll-sass-converter (~> 2.0)
      jekyll-watch (~> 2.0)
      kramdown (~> 2.3)
      kramdown-parser-gfm (~> 1.0)
      liquid (~> 4.0)
      mercenary (~> 0.4.0)
      pathutil (~> 0.9)
      rouge (~> 3.0)
      safe_yaml (~> 1.0)
      terminal-table (~> 2.0)
    jekyll-archives (2.2.1)
      jekyll (>= 3.6, < 5.0)
    jekyll-avatar (0.7.0)
      jekyll (>= 3.0, < 5.0)
    jekyll-feed (0.15.1)
      jekyll (>= 3.7, < 5.0)
    jekyll-gist (1.5.0)
      octokit (~> 4.2)
    jekyll-include-cache (0.2.1)
      jekyll (>= 3.7, < 5.0)
    jekyll-paginate (1.1.0)
    jekyll-redirect-from (0.16.0)
      jekyll (>= 3.3, < 5.0)
    jekyll-sass-converter (2.1.0)
      sassc (> 2.0.1, < 3.0)
    jekyll-sitemap (1.4.0)
      jekyll (>= 3.7, < 5.0)
    jekyll-watch (2.2.1)
      listen (~> 3.0)
    kramdown (2.3.1)
      rexml
    kramdown-parser-gfm (1.1.0)
      kramdown (~> 2.0)
    liquid (4.0.3)
    listen (3.7.0)
      rb-fsevent (~> 0.10, >= 0.10.3)
      rb-inotify (~> 0.9, >= 0.9.10)
    mercenary (0.4.0)
    minimal-mistakes-jekyll (4.24.0)
      jekyll (>= 3.7, < 5.0)
      jekyll-feed (~> 0.1)
      jekyll-gist (~> 1.5)
      jekyll-include-cache (~> 0.1)
      jekyll-paginate (~> 1.1)
      jekyll-sitemap (~> 1.3)
    multipart-post (2.1.1)
    octokit (4.21.0)
      faraday (>= 0.9)
      sawyer (~> 0.8.0, >= 0.5.3)
    pathutil (0.16.2)
      forwardable-extended (~> 2.6)
    public_suffix (4.0.6)
    rb-fsevent (0.11.0)
    rb-inotify (0.10.1)
      ffi (~> 1.0)
    rexml (3.2.5)
    rouge (3.26.1)
    ruby2_keywords (0.0.5)
    safe_yaml (1.0.5)
    sassc (2.4.0)
      ffi (~> 1.9)
    sawyer (0.8.2)
      addressable (>= 2.3.5)
      faraday (> 0.8, < 2.0)
    terminal-table (2.0.0)
      unicode-display_width (~> 1.1, >= 1.1.1)
    thread_safe (0.3.6)
    tzinfo (1.2.10)
      thread_safe (~> 0.1)
    tzinfo-data (1.2021.1)
      tzinfo (>= 1.0.0)
    unicode-display_width (1.8.0)
    wdm (0.1.1)

PLATFORMS
  ruby

DEPENDENCIES
  jekyll (~> 4.2.0)
  jekyll-archives (~> 2.2)
  jekyll-avatar (~> 0.7)
  jekyll-feed (~> 0.6)
  jekyll-redirect-from (~> 0.16)
  minimal-mistakes-jekyll (~> 4.24)
  tzinfo (~> 1.2)
  tzinfo-data
  wdm (~> 0.1.0)

BUNDLED WITH
   2.3.24

that reproduce the issue.

Trying to build a container for a project with just these two files leads to:

Running the postCreateCommand from devcontainer.json...

[21812 ms] Start: Run in container: /bin/sh -c sh ./.devcontainer/post-create.sh
Fetching bundler-2.3.24.gem
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /usr/local/rvm/gems/default directory.
        /usr/local/lib/ruby/site_ruby/2.7.0/rubygems/installer.rb:712:in `verify_gem_home'
        /usr/local/lib/ruby/site_ruby/2.7.0/rubygems/installer.rb:902:in `pre_install_checks'
        /usr/local/lib/ruby/site_ruby/2.7.0/rubygems/installer.rb:302:in `install'
        /usr/local/lib/ruby/site_ruby/2.7.0/rubygems/resolver/specification.rb:104:in `install'
        /usr/local/lib/ruby/site_ruby/2.7.0/rubygems/request_set.rb:194:in `block in install'
        /usr/local/lib/ruby/site_ruby/2.7.0/rubygems/request_set.rb:182:in `each'
        /usr/local/lib/ruby/site_ruby/2.7.0/rubygems/request_set.rb:182:in `install'
        /usr/local/lib/ruby/site_ruby/2.7.0/rubygems/commands/install_command.rb:214:in `install_gem'
        /usr/local/lib/ruby/site_ruby/2.7.0/rubygems/commands/install_command.rb:230:in `block in install_gems'
        /usr/local/lib/ruby/site_ruby/2.7.0/rubygems/commands/install_command.rb:223:in `each'
        /usr/local/lib/ruby/site_ruby/2.7.0/rubygems/commands/install_command.rb:223:in `install_gems'
        /usr/local/lib/ruby/site_ruby/2.7.0/rubygems/commands/install_command.rb:169:in `execute'
        /usr/local/lib/ruby/site_ruby/2.7.0/rubygems/command.rb:323:in `invoke_with_build_args'
        /usr/local/lib/ruby/site_ruby/2.7.0/rubygems/command_manager.rb:251:in `invoke_command'
        /usr/local/lib/ruby/site_ruby/2.7.0/rubygems/command_manager.rb:191:in `process_args'
        /usr/local/lib/ruby/site_ruby/2.7.0/rubygems/command_manager.rb:149:in `run'
        /usr/local/lib/ruby/site_ruby/2.7.0/rubygems/gem_runner.rb:51:in `run'
        /usr/local/bin/gem:10:in `<main>'

I had a look and I see that the /usr/local/rvm/gems/default directory is run by root, but I suspect the post create script runs as non-root.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions