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

For your consideration: serving local gems to enable Docker builds that refer to local changes #287

Open
ianfixes opened this issue Mar 5, 2021 · 0 comments

Comments

@ianfixes
Copy link

ianfixes commented Mar 5, 2021

Based on the rubygems.org guide on running your own gem server I was able to solve a problem that I had been having:

In local development, I can specify local gems as dependencies in my Gemfile by using the path: '../path/to/gem' option. But if I want to test that in a Docker container, I run into the limitation that docker build will fail -- Docker can't include files from outside its build context

This creates an uncomfortable choice: temporarily rewrite all the Dockerfile logic to change the docker context to my entire development directory -- very poor performance -- or fully publish all my beta gem versions after every edit.

My idea was to leverage gemstash as a local server, and wrap it in some logic that could watch my gem directories for changes -- automatically handling the build/publish to the local server.
This allows the Gemfile to refer to that local server address, such that Docker builds can access them.

That code is at ianfixes/local-gemstasher, on DockerHub as ianfixes/local_gemstasher. Details in the README on how to set up the server and the Gemfile.

Was there a better way to do this sort of thing that I failed to consider? If not, I can recommend a few small changes to the server that would streamline this effort.

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

1 participant