FROM ruby:3.4.9-alpine3.23 # Install build dependencies for native gems RUN apk add --no-cache build-base ruby-dev libffi-dev # Set work directory WORKDIR /app # Copy project files COPY . . # If Gemfile is not present in the repo, create a minimal Gemfile for predictable Bundler behavior RUN set -e; if [ ! -f Gemfile ]; then printf "source 'https://rubygems.org'\n\ngem 'rack'\n" > Gemfile; fi # Ensure Bundler is available and install dependencies RUN gem install bundler RUN bundle install --path vendor/bundle # Expose Rack port EXPOSE 9292 # Run the Rack app CMD ["bundle", "exec", "rackup", "-o", "0.0.0.0", "-p", "9292"]
# Ignore things that aren't needed in the build context .git node_modules vendor/bundle .DS_Store *.log
- Failing step (command/step): [7/7] RUN bundle install --path vendor/bundle - Exit code: 15 - Exact error message: The `--path` flag has been removed because it relied on being remembered across bundler invocations, which bundler no longer does. Instead please use `bundle config set path 'vendor/bundle'`, and stop using this flag - Missing packages or files mentioned: None reported (Gemfile was created earlier; no missing files noted) - Version mismatch / related info: - Bundler version installed: bundler-4.0.8 - The error indicates a Bundler CLI change: the --path flag has been removed; use bundle config set path 'vendor/bundle' instead Remediation hint: Update Dockerfile to replace bundle install --path vendor/bundle with a Bundler path configuration, e.g., bundle config set path 'vendor/bundle' followed by bundle install.
FROM ruby:3.4.9-alpine3.23 # Install build dependencies for native gems RUN apk add --no-cache build-base ruby-dev libffi-dev # Set work directory WORKDIR /app # Copy project files COPY . . # If Gemfile is not present in the repo, create a minimal Gemfile for predictable Bundler behavior RUN set -e; if [ ! -f Gemfile ]; then printf "source 'https://rubygems.org'\n\nGem::DefaultManifest变 fi
FROM ruby:3.4.9-alpine3.23 # Install build dependencies for native gems RUN apk add --no-cache build-base ruby-dev libffi-dev # Set work directory WORKDIR /app # Copy project files COPY . . # If Gemfile is not present in the repo, create a minimal Gemfile for predictable Bundler behavior RUN set -e; if [ ! -f Gemfile ]; then printf "source 'https://rubygems.org'\n\ngem 'rack'\n" > Gemfile; fi # Ensure Bundler is available and install dependencies RUN gem install bundler RUN bundle config set path 'vendor/bundle' RUN bundle install # Expose Rack port EXPOSE 9292 # Run the Rack app CMD ["bundle", "exec", "rackup", "-o", "0.0.0.0", "-p", "9292"]
Concerns: FROM ruby:3.4.9-alpine3.23 may reference a non-existent Ruby tag; verify the Ruby version tag is valid and published., The smoke tests do not validate the web service endpoint (e.g., starting rackup and performing an HTTP request). Consider adding a test that launches the server and hits the Rack app root., If the repo does not include a config.ru (Rack config), rackup may fail at runtime. Ensure a Rack entrypoint exists or that the Gemfile provides an appropriate rackup configuration. Smoke [PASS]: ruby -v && bundle -v Smoke [PASS]: test -f Gemfile || test -f /app/Gemfile Smoke [PASS]: ls -la /app | head -n 5