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

Should gem projects be supported here? #761

Open
3 tasks
fgrehm opened this issue Apr 12, 2022 · 6 comments
Open
3 tasks

Should gem projects be supported here? #761

fgrehm opened this issue Apr 12, 2022 · 6 comments

Comments

@fgrehm
Copy link

fgrehm commented Apr 12, 2022

What happened?

What were you attempting to do?

Build an image for a project that is also published as a gem for internal use. TLDR it is a gem that is used by client apps for "kafka interactions" which also bundles some reusable tasks that we run across all of our staging clusters through a Docker image built with CNB buildpacks.

Yes we could write a Dockerfile instead but it'd be amazing if we could just leverage the same CNB infra we have for other ruby / rails projects we maintain.

What did you expect to happen?

Build should succeed, but we hit a few snags. Also, FWIW I have no idea if other builders like heroku's support this use case, so totally fine if you folks feel like this is not something you wanna move forward with

What was the actual behavior? Please provide log output, if possible.

Some of the "snags" mentioned above include:

  • Detect the bundler version to install based on what is present on the .gemspec: fixed by setting BP_BUNDLER_VERSION
  • Dependency on git command on gemspec

Build Configuration

What platform (pack, kpack, tekton buildpacks plugin, etc.) are you using? Please include a version.

We got our own way of building things, including a base image that builds on top of paketo stacks (only using the full one for real ATM). It relies on the execution of individual steps with lifecycle CLI as we kinda reimplement the lifecycle creator with some additional logic that makes sense to us (ex: a custom cache fallback mechanism we use).

The builder is being created by pack v0.24.0, so it uses whatever lifecycle release it injects under the hood.

What buildpacks are you using? Please include versions.

Click to see
Inspecting builder: <REDACTED>-builder:full-v0.5.0

REMOTE:

Description: Ubuntu bionic base image with buildpacks for Golang, Ruby and Nodejs

Created By:
  Name: Pack CLI
  Version: 0.24.0+git-79a40b7.build-3148

Trusted: No

Stack:
  ID: io.buildpacks.stacks.bionic

Lifecycle:
  Version: 0.13.3
  Buildpack APIs:
    Deprecated: (none)
    Supported: 0.2, 0.3, 0.4, 0.5, 0.6, 0.7
  Platform APIs:
    Deprecated: (none)
    Supported: 0.3, 0.4, 0.5, 0.6, 0.7, 0.8

Run Images:
  <REDACTED>-stack-run:bionic-full-f73c656-b638

Buildpacks:
  ID                                             NAME                                                            VERSION        HOMEPAGE
  paketo-buildpacks/bundle-install               Paketo Bundle Install Buildpack                                 0.3.1          https://github.com/paketo-buildpacks/bundle-install
  paketo-buildpacks/bundler                      Paketo Bundler Buildpack                                        0.3.1          https://github.com/paketo-buildpacks/bundler
  paketo-buildpacks/ca-certificates              Paketo CA Certificates Buildpack                                3.0.2          https://github.com/paketo-buildpacks/ca-certificates
  paketo-buildpacks/ca-certificates              Paketo CA Certificates Buildpack                                3.1.0          https://github.com/paketo-buildpacks/ca-certificates
  paketo-buildpacks/dep                          Paketo Dep Buildpack                                            0.3.0          https://github.com/paketo-buildpacks/dep
  paketo-buildpacks/dep-ensure                   Paketo Dep Ensure Buildpack                                     0.2.1          https://github.com/paketo-buildpacks/dep-ensure
  paketo-buildpacks/environment-variables        Paketo Environment Variables Buildpack                          4.0.2          https://github.com/paketo-buildpacks/environment-variables
  paketo-buildpacks/environment-variables        Paketo Environment Variables Buildpack                          4.1.0          https://github.com/paketo-buildpacks/environment-variables
  paketo-buildpacks/git                          Paketo Git Buildpack                                            0.4.1          https://github.com/paketo-buildpacks/git
  paketo-buildpacks/go                           Paketo Go Buildpack                                             1.0.0          https://github.com/paketo-buildpacks/go
  paketo-buildpacks/go-build                     Paketo Go Build Buildpack                                       1.0.2          https://github.com/paketo-buildpacks/go-build
  paketo-buildpacks/go-dist                      Paketo Go Distribution Buildpack                                1.0.1          https://github.com/paketo-buildpacks/go-dist
  paketo-buildpacks/go-mod-vendor                Paketo Go Mod Vendor Buildpack                                  0.5.0          https://github.com/paketo-buildpacks/go-mod-vendor
  paketo-buildpacks/image-labels                 Paketo Image Labels Buildpack                                   4.0.2          https://github.com/paketo-buildpacks/image-labels
  paketo-buildpacks/image-labels                 Paketo Image Labels Buildpack                                   4.1.0          https://github.com/paketo-buildpacks/image-labels
  paketo-buildpacks/mri                          Paketo MRI Buildpack                                            0.6.0          https://github.com/paketo-buildpacks/mri
  paketo-buildpacks/node-engine                  Paketo Node Engine Buildpack                                    0.11.4         https://github.com/paketo-buildpacks/node-engine
  paketo-buildpacks/node-engine                  Paketo Node Engine Buildpack                                    0.12.1         https://github.com/paketo-buildpacks/node-engine
  paketo-buildpacks/node-module-bom              Paketo Node Module Bill of Materials Generator Buildpack        0.2.3          https://github.com/paketo-buildpacks/node-module-bom
  paketo-buildpacks/node-run-script              Paketo Node Run Script Buildpack                                0.3.2          https://github.com/paketo-buildpacks/node-run-script
  paketo-buildpacks/node-start                   Paketo Node Start Buildpack                                     0.7.1          https://github.com/paketo-buildpacks/node-start
  paketo-buildpacks/nodejs                       Paketo Node.js Buildpack                                        0.16.0         https://github.com/paketo-buildpacks/nodejs
  paketo-buildpacks/npm-install                  Paketo NPM Install Buildpack                                    0.8.0          https://github.com/paketo-buildpacks/npm-install
  paketo-buildpacks/npm-start                    Paketo NPM Start Buildpack                                      0.8.0          https://github.com/paketo-buildpacks/npm-start
  paketo-buildpacks/passenger                    Paketo Passenger Buildpack                                      0.3.1          https://github.com/paketo-buildpacks/passenger
  paketo-buildpacks/procfile                     Paketo Procfile Buildpack                                       5.0.2          https://github.com/paketo-buildpacks/procfile
  paketo-buildpacks/procfile                     Paketo Procfile Buildpack                                       5.1.0          https://github.com/paketo-buildpacks/procfile
  paketo-buildpacks/puma                         Paketo Puma Buildpack                                           0.2.1          https://github.com/paketo-buildpacks/puma
  paketo-buildpacks/rackup                       Paketo Rackup Buildpack                                         0.2.1          https://github.com/paketo-buildpacks/rackup
  paketo-buildpacks/rails-assets                 Paketo Rails Assets Buildpack                                   0.4.1          https://github.com/paketo-buildpacks/rails-assets
  paketo-buildpacks/rake                         Paketo Rake Buildpack                                           0.2.1          https://github.com/paketo-buildpacks/rake
  paketo-buildpacks/ruby                         Paketo Ruby Buildpack                                           0.11.0         https://github.com/paketo-buildpacks/ruby
  paketo-buildpacks/thin                         Paketo Thin Buildpack                                           0.2.1          https://github.com/paketo-buildpacks/thin
  paketo-buildpacks/unicorn                      Paketo Unicorn Buildpack                                        0.2.1          https://github.com/paketo-buildpacks/unicorn
  paketo-buildpacks/watchexec                    Paketo Watchexec Buildpack                                      2.3.0          https://github.com/paketo-buildpacks/watchexec
  paketo-buildpacks/yarn                         Paketo Yarn Buildpack                                           0.5.1          https://github.com/paketo-buildpacks/yarn
  paketo-buildpacks/yarn                         Paketo Yarn Buildpack                                           0.6.0          https://github.com/paketo-buildpacks/yarn
  paketo-buildpacks/yarn-install                 Paketo Yarn Install Buildpack                                   0.7.1          https://github.com/paketo-buildpacks/yarn-install
  paketo-buildpacks/yarn-install                 Paketo Yarn Install Buildpack                                   0.8.0          https://github.com/paketo-buildpacks/yarn-install
  paketo-buildpacks/yarn-start                   Paketo Yarn Start Buildpack                                     0.7.1          https://github.com/paketo-buildpacks/yarn-start

Detection Order:
 ├ Group #1:
 │  ├ paketo-buildpacks/ruby
 │  │  └ Group #1:
 │  │     ├ paketo-buildpacks/[email protected]          (optional)
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]             (optional)
 │  │     ├ paketo-buildpacks/[email protected]                     (optional)
 │  │     ├ paketo-buildpacks/[email protected]             (optional)
 │  │     ├ paketo-buildpacks/[email protected]             (optional)
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]                 (optional)
 │  │     ├ paketo-buildpacks/[email protected]    (optional)
 │  │     └ paketo-buildpacks/[email protected]             (optional)
 │  ├ paketo-buildpacks/ruby
 │  │  └ Group #2:
 │  │     ├ paketo-buildpacks/[email protected]          (optional)
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]             (optional)
 │  │     ├ paketo-buildpacks/[email protected]                     (optional)
 │  │     ├ paketo-buildpacks/[email protected]             (optional)
 │  │     ├ paketo-buildpacks/[email protected]             (optional)
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]                 (optional)
 │  │     ├ paketo-buildpacks/[email protected]    (optional)
 │  │     └ paketo-buildpacks/[email protected]             (optional)
 │  ├ paketo-buildpacks/ruby
 │  │  └ Group #3:
 │  │     ├ paketo-buildpacks/[email protected]          (optional)
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]             (optional)
 │  │     ├ paketo-buildpacks/[email protected]                     (optional)
 │  │     ├ paketo-buildpacks/[email protected]             (optional)
 │  │     ├ paketo-buildpacks/[email protected]             (optional)
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]                 (optional)
 │  │     ├ paketo-buildpacks/[email protected]    (optional)
 │  │     └ paketo-buildpacks/[email protected]             (optional)
 │  ├ paketo-buildpacks/ruby
 │  │  └ Group #4:
 │  │     ├ paketo-buildpacks/[email protected]          (optional)
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]             (optional)
 │  │     ├ paketo-buildpacks/[email protected]                     (optional)
 │  │     ├ paketo-buildpacks/[email protected]             (optional)
 │  │     ├ paketo-buildpacks/[email protected]             (optional)
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]                 (optional)
 │  │     ├ paketo-buildpacks/[email protected]    (optional)
 │  │     └ paketo-buildpacks/[email protected]             (optional)
 │  ├ paketo-buildpacks/ruby
 │  │  └ Group #5:
 │  │     ├ paketo-buildpacks/[email protected]          (optional)
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]             (optional)
 │  │     ├ paketo-buildpacks/[email protected]                     (optional)
 │  │     ├ paketo-buildpacks/[email protected]             (optional)
 │  │     ├ paketo-buildpacks/[email protected]             (optional)
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]                 (optional)
 │  │     ├ paketo-buildpacks/[email protected]    (optional)
 │  │     └ paketo-buildpacks/[email protected]             (optional)
 │  └ paketo-buildpacks/ruby
 │     └ Group #6:
 │        ├ paketo-buildpacks/[email protected]          (optional)
 │        ├ paketo-buildpacks/[email protected]
 │        ├ paketo-buildpacks/[email protected]                  (optional)
 │        ├ paketo-buildpacks/[email protected]           (optional)
 │        ├ paketo-buildpacks/[email protected]
 │        ├ paketo-buildpacks/[email protected]                 (optional)
 │        ├ paketo-buildpacks/[email protected]    (optional)
 │        └ paketo-buildpacks/[email protected]             (optional)
 ├ Group #2:
 │  ├ paketo-buildpacks/nodejs
 │  │  └ Group #1:
 │  │     ├ paketo-buildpacks/[email protected]          (optional)
 │  │     ├ paketo-buildpacks/[email protected]                (optional)
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]          (optional)
 │  │     ├ paketo-buildpacks/[email protected]          (optional)
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]                 (optional)
 │  │     ├ paketo-buildpacks/[email protected]    (optional)
 │  │     └ paketo-buildpacks/[email protected]             (optional)
 │  ├ paketo-buildpacks/nodejs
 │  │  └ Group #2:
 │  │     ├ paketo-buildpacks/[email protected]          (optional)
 │  │     ├ paketo-buildpacks/[email protected]                (optional)
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]          (optional)
 │  │     ├ paketo-buildpacks/[email protected]          (optional)
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]                 (optional)
 │  │     ├ paketo-buildpacks/[email protected]    (optional)
 │  │     └ paketo-buildpacks/[email protected]             (optional)
 │  └ paketo-buildpacks/nodejs
 │     └ Group #3:
 │        ├ paketo-buildpacks/[email protected]          (optional)
 │        ├ paketo-buildpacks/[email protected]                (optional)
 │        ├ paketo-buildpacks/[email protected]
 │        ├ paketo-buildpacks/[email protected]          (optional)
 │        ├ paketo-buildpacks/[email protected]
 │        ├ paketo-buildpacks/[email protected]                 (optional)
 │        ├ paketo-buildpacks/[email protected]    (optional)
 │        └ paketo-buildpacks/[email protected]             (optional)
 └ Group #3:
    ├ paketo-buildpacks/go
    │  └ Group #1:
    │     ├ paketo-buildpacks/[email protected]          (optional)
    │     ├ paketo-buildpacks/[email protected]                (optional)
    │     ├ paketo-buildpacks/[email protected]
    │     ├ paketo-buildpacks/[email protected]                      (optional)
    │     ├ paketo-buildpacks/[email protected]
    │     ├ paketo-buildpacks/[email protected]
    │     ├ paketo-buildpacks/[email protected]                 (optional)
    │     ├ paketo-buildpacks/[email protected]    (optional)
    │     └ paketo-buildpacks/[email protected]             (optional)
    ├ paketo-buildpacks/go
    │  └ Group #2:
    │     ├ paketo-buildpacks/[email protected]          (optional)
    │     ├ paketo-buildpacks/[email protected]                (optional)
    │     ├ paketo-buildpacks/[email protected]
    │     ├ paketo-buildpacks/[email protected]                      (optional)
    │     ├ paketo-buildpacks/[email protected]
    │     ├ paketo-buildpacks/[email protected]
    │     ├ paketo-buildpacks/[email protected]
    │     ├ paketo-buildpacks/[email protected]                 (optional)
    │     ├ paketo-buildpacks/[email protected]    (optional)
    │     └ paketo-buildpacks/[email protected]             (optional)
    └ paketo-buildpacks/go
       └ Group #3:
          ├ paketo-buildpacks/[email protected]          (optional)
          ├ paketo-buildpacks/[email protected]                (optional)
          ├ paketo-buildpacks/[email protected]                      (optional)
          ├ paketo-buildpacks/[email protected]
          ├ paketo-buildpacks/[email protected]
          ├ paketo-buildpacks/[email protected]                 (optional)
          ├ paketo-buildpacks/[email protected]    (optional)
          └ paketo-buildpacks/[email protected]             (optional)

LOCAL:
(not present)

Can you provide a sample app or relevant configuration (buildpack.yml, nginx.conf, etc.)?

Sure, please see note below, happy to provide more info if you really want to pursue this

Checklist

Note yet, see note below

  • I have included log output.
  • The log output includes an error message.
  • I have included steps for reproduction.

NOTE: Guidance needed

I'm happy to provide additional information like logs and test cases for you folks to see what we're experiencing but at this stage I'm mostly interested in knowing whether providing better support for apps that have .gemspecs is something you are interested in pursuing or not 😄

I'd also wonder in which repo I should open the issue, like here, or one of the ruby's "sub-buildpacks"

@sophiewigmore
Copy link
Member

sophiewigmore commented Apr 14, 2022

Hey @fgrehm, thanks for the details. To me, this seems like a solid use case to support in the buildpacks, so I'd like to investigate what this would look like. I'd love to see the build logs from the failed build if possible? Also some information on the structure of your project would be helpful

@fgrehm
Copy link
Author

fgrehm commented Apr 18, 2022

Hey Sophie! Thanks for the reply. I'll look into preparing a minimal reproducible example to share with you folks this week.

@fgrehm
Copy link
Author

fgrehm commented Apr 25, 2022

Sorry folks, haven't been able to get to this last week but will try this one

@sophiewigmore
Copy link
Member

No rush, we'll take a look whenever you have time

@sophiewigmore
Copy link
Member

Hey @fgrehm is this still an issue for you?

@fgrehm
Copy link
Author

fgrehm commented Aug 17, 2022

Sorry for the delay! Here's how to reproduce:

Click to see commands

Environment:

$ pack version
0.24.0+git-79a40b7.build-3148
$ bundle version
Bundler version 2.2.7 (2021-01-27 commit 7bc7ecb660)
$ ruby -v
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-linux]
$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.4 LTS"

Create gem:

$ bundle gem gem-app --exe --no-coc
Creating gem 'gem-app'...
MIT License enabled in config
RuboCop enabled in config
      create  gem-app/Gemfile
      create  gem-app/lib/gem/app.rb
      create  gem-app/lib/gem/app/version.rb
      create  gem-app/gem-app.gemspec
      create  gem-app/Rakefile
      create  gem-app/README.md
      create  gem-app/bin/console
      create  gem-app/bin/setup
      create  gem-app/.gitignore
      create  gem-app/.rspec
      create  gem-app/spec/spec_helper.rb
      create  gem-app/spec/gem/app_spec.rb
      create  gem-app/.circleci/config.yml
      create  gem-app/LICENSE.txt
      create  gem-app/.rubocop.yml
      create  gem-app/exe/gem-app
Initializing git repo in /home/fabio/projects/playground/gem-app
Gem 'gem-app' was successfully created. For more information on making a RubyGem visit https://bundler.io/guides/creating_gem.html

Edit gemspec to remove unecessary attributes and bundle install afterwards:

$ cat gem-app.gemspec 
require_relative "lib/gem/app/version"

Gem::Specification.new do |spec|
  spec.name          = "gem-app"
  spec.version       = Gem::App::VERSION
  spec.authors       = ["Foo Bar"]
  spec.email         = ["[email protected]"]

  spec.summary       = "test for paketo"
  spec.license       = "MIT"
  spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")

  # Specify which files should be added to the gem when it is released.
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
    `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
  end
  spec.bindir        = "exe"
  spec.executables   = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
  spec.require_paths = ["lib"]
end

Edit executable to output some text for debugging and confirm it works:

$ cat exe/gem-app 
#!/usr/bin/env ruby
require "gem/app"
puts "Hello world"

$ bundle exec gem-app
Hello world

Build app:

$ pack build gem-app --path . --builder paketobuildpacks/builder:full
full: Pulling from paketobuildpacks/builder
Digest: sha256:07591d4d347a4fd49e2d63f17c5f5d1bf1a31f5eee921f72de87b67940703e3e
Status: Image is up to date for paketobuildpacks/builder:full
full-cnb: Pulling from paketobuildpacks/run
Digest: sha256:058ec9a42c39c678dbddd29a1f550e18d1cf10c084f9fdeb56a56d27e80bd345
Status: Image is up to date for paketobuildpacks/run:full-cnb
Restoring data for SBOM from previous image
===> DETECTING
5 of 8 buildpacks participating
paketo-buildpacks/ca-certificates 3.2.4
paketo-buildpacks/mri             0.8.3
paketo-buildpacks/bundler         0.5.3
paketo-buildpacks/bundle-install  0.5.2
paketo-buildpacks/rake            0.4.0
===> RESTORING
Restoring metadata for "paketo-buildpacks/ca-certificates:helper" from app image
Restoring metadata for "paketo-buildpacks/mri:mri" from app image
Restoring metadata for "paketo-buildpacks/bundler:bundler" from app image
Restoring metadata for "paketo-buildpacks/bundle-install:launch-gems" from app image
Restoring data for "paketo-buildpacks/mri:mri" from cache
Restoring data for "paketo-buildpacks/bundler:bundler" from cache
Restoring data for SBOM from cache
===> BUILDING

Paketo CA Certificates Buildpack 3.2.4
  https://github.com/paketo-buildpacks/ca-certificates
  Launch Helper: Reusing cached layer
Paketo MRI Buildpack 0.8.3
  Resolving MRI version
    Candidate version sources (in priority order):
      <unknown> -> ""

    Selected MRI version (using <unknown>): 2.7.6

  Reusing cached layer /layers/paketo-buildpacks_mri/mri

Paketo Bundler Buildpack 0.5.3
  Resolving Bundler version
    Candidate version sources (in priority order):
      Gemfile.lock -> "2.*.*"
      <unknown>    -> ""

    Selected Bundler version (using Gemfile.lock): 2.3.17

  Reusing cached layer /layers/paketo-buildpacks_bundler/bundler

Paketo Bundle Install Buildpack 0.5.2
  Reusing cached layer /layers/paketo-buildpacks_bundle-install/launch-gems

Paketo Rake Buildpack 0.4.0
  Assigning launch processes:
    web (default): bundle exec rake

===> EXPORTING
Reusing layer 'paketo-buildpacks/ca-certificates:helper'
Reusing layer 'paketo-buildpacks/mri:mri'
Reusing layer 'paketo-buildpacks/bundler:bundler'
Reusing layer 'paketo-buildpacks/bundle-install:launch-gems'
Reusing layer 'launch.sbom'
Reusing 1/1 app layer(s)
Reusing layer 'launcher'
Reusing layer 'config'
Reusing layer 'process-types'
Adding label 'io.buildpacks.lifecycle.metadata'
Adding label 'io.buildpacks.build.metadata'
Adding label 'io.buildpacks.project.metadata'
Setting default process type 'web'
Saving gem-app...
*** Images (3abbf57d7b2a):
      gem-app
Reusing cache layer 'paketo-buildpacks/mri:mri'
Reusing cache layer 'paketo-buildpacks/bundler:bundler'
Reusing cache layer 'cache.sbom'
Successfully built image gem-app

Try to run it:

$ docker run -ti --rm gem-app -- bundle exec gem-app

[!] There was an error parsing `Gemfile`: 
[!] There was an error while loading `gem-app.gemspec`: No such file or directory - git. Bundler cannot continue.

 #  from /workspace/gem-app.gemspec:18
 #  -------------------------------------------
 #    spec.files = Dir.chdir(File.expand_path(__dir__)) do
 >      `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
 #    end
 #  -------------------------------------------
. Bundler cannot continue.

 #  from /workspace/Gemfile:6
 #  -------------------------------------------
 #  # Specify your gem's dependencies in gem-app.gemspec
 >  gemspec
 #  
 #  -------------------------------------------

As I mentioned on the issue description, we have a way to work around this, the issue is that git is not present on the runtime image, neither the .git/ will be there.

I'm just wondering if there's anything we could do here besides providing guidance on official documentation on how to fix that error message. I think the answer is no, but maybe you folks have ideas 😄

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

2 participants