Skip to content

Conversation

@thavaahariharangit
Copy link
Contributor

@thavaahariharangit thavaahariharangit commented Feb 6, 2026

What are you trying to accomplish?

The rm .bundle/bin/bundle command fails if the file doesn't exist, breaking the Docker build. Using rm -f makes the removal idempotent and prevents build failures when the binstub isn't present.

Anything you want to highlight for special attention from reviewers?

Simple one-liner. The -f flag suppresses errors for missing files while still removing the file when it exists.

How will you know you've accomplished your goal?

Before this change, building the UV image locally with bin/docker-dev-shell uv --rebuild command would fail during the dependabot-updater step:

 => ERROR [5/6] RUN cd dependabot-updater   && bundle config unset without   && bundle install   && BUNDLE_BIN=.bundle/bin bund  1.7s 
------                                                                                                                                
 > [5/6] RUN cd dependabot-updater   && bundle config unset without   && bundle install   && BUNDLE_BIN=.bundle/bin bundle binstubs --all   && rm .bundle/bin/bundle # let RubyGems manage Bundler:                                                                         
1.361 Bundle complete! 63 Gemfile dependencies, 150 gems now installed.
1.361 Bundled gems are installed into `./vendor`
1.635 Bundler itself does not use binstubs because its version is selected by RubyGems
1.691 rm: cannot remove '.bundle/bin/bundle': No such file or directory
------
Dockerfile.development:27
--------------------
  26 |     
  27 | >>> RUN cd dependabot-updater \
  28 | >>>   && bundle config unset without \
  29 | >>>   && bundle install \
  30 | >>>   && BUNDLE_BIN=.bundle/bin bundle binstubs --all \
  31 | >>>   && rm .bundle/bin/bundle # let RubyGems manage Bundler
  32 |     
--------------------
ERROR: failed to build: failed to solve: process "/bin/bash -o pipefail -c cd dependabot-updater   && bundle config unset without   && bundle install   && BUNDLE_BIN=.bundle/bin bundle binstubs --all   && rm .bundle/bin/bundle # let RubyGems manage Bundler" did not complete successfully: exit code: 1

1.691 rm: cannot remove '.bundle/bin/bundle': No such file or directory

After this change
The Dockerfile.development builds successfully regardless of whether the bundle binstub exists.

Checklist

  • I have run the complete test suite to ensure all tests and linters pass.
  • I have thoroughly tested my code changes to ensure they work as expected, including adding additional tests for new functionality.
  • I have written clear and descriptive commit messages.
  • I have provided a detailed description of the changes in the pull request, including the problem it addresses, how it fixes the problem, and any relevant details about the implementation.
  • I have ensured that the code is well-documented and easy to understand.

@thavaahariharangit thavaahariharangit requested a review from a team as a code owner February 6, 2026 14:27
@thavaahariharangit thavaahariharangit merged commit 557826d into main Feb 9, 2026
83 checks passed
@thavaahariharangit thavaahariharangit deleted the harry/fix-dockerfile-dev-rm-bundle-binstub branch February 9, 2026 12:55
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

Successfully merging this pull request may close these issues.

2 participants