Comments (5)
Hi!
I agree it would be helpful if there was a better story for this. Longer term Cloud Native Buildpacks are going to be the solution for this, since with them, one can run virtually an identical build locally as is run in production.
In the meantime I'd check out the Dockerflles in #56 - particularly the more recent comments - there's an example of using the Ruby buildpack to install Ruby.
Alternatively a pretty string option is to just use the official Docker Ruby images (much lighter-weight than the Heroku stack images for local development) and instead rely on Heroku CI/Review Apps/staging app to ensure correctness before production deployment. After all, there are many many differences running locally compared to production (the docker image is likely the least of it; differences in DB configuration/version, RAILS_ENV, ...) so there still needs to be validation performed on Heroku and not just locally.
When attempting to update Ruby from a heroku buildpack, what USED to work (in heroku:18-build) is:
Yeah I wouldn't do that. Use the whole Ruby buildpack and not just the Ruby binary archive. The archive is not meant to be extracted over the system packages. The Ruby buildpack installs the files into the app directory and adds them to PATH, GEM_PATH etc.
from base-images.
In the meantime I've pinned #56 to improve visibility.
from base-images.
Thank you Ed. Can you offer a specific suggestion re "official Docker Ruby images" for Rails apps that will end up on Heroku? In https://hub.docker.com/_/ruby for example there are a lot of options: 2.7.3-buster, 2.7.3-slim-buster, 2.7.3-alpine3.13, 2.7.3-alpine3.12 which is Alpine and Debian, but Heroku uses Ubuntu, yes? and none of the options in that docker hub seem to be Ubuntu.
And of course then there is the issue of all the many apt-get packages to include. Any suggestions for figuring that out?
I suspect I'm not the only Heroku user who uses Heroku precisely so I can focus on my app instead of hundreds of pieces of underlying stack-related minutiae (well, plus the excellent devops of course). So it's unfortunate to discover that no, the Heroku stack images are not a way to quickly configure Docker so we can get back to app development.
It seems like "Sample Dockerfile for a Rails 6 app destined for Heroku-20" would be something Heroku could/should/would publish.
from base-images.
Many of our internal Ruby projects don't use docker for local development and instead run on the local machine. We then use Heroku CI/Review Apps/staging apps to catch any dev-prod parity issues. If you would prefer to use Docker locally, then I don't think it matters too much which base image you use. In terms of apt packages, just install the absolute minimum so that gems install (eg libpq
if using the pg gem).
A local testing environment is never going to fully match a remote production environment, and of the things that differ, the fact that the Docker image OS is Debian vs Ubuntu is much less frequently going to be the cause compared to other factors (eg different env vars, different DB configuration/version/not full prod data, framework debug mode, different load balancer, not real production user load etc). And for the cases where it does matter - there's still Review Apps, staging apps etc.
There are obviously tradeoffs of all approaches, however I think usability locally can often be more important than trying to have still only partial prod-parity.
from base-images.
You are more experienced and probably correct re the tradeoffs of local stack simplicity vs dev/prod parity. However (and maybe because I'm an old guy) I've always leaned pretty hard towards "try to catch at least some of the 'big' gotchas as early as possible right on the dev machine."
That said, review apps and staging apps have been awesomely helpful (we use both). And even wrote up a small blog post favorably comparing the speed of Heroku CI vs rspec locally: https://blog.pardner.com/2019/01/making-heroku-ci-almost-as-fast-as-running-rspec-locally/
from base-images.
Related Issues (20)
- ld is required by python.ctypes.util.find_library HOT 2
- With `heroku/heroku:18`, `gem install bundler` fails HOT 2
- Heroku-16 stack image build failing due to missing lsb-release package
- Breaking changes in PostgreSQL 12's libpq HOT 10
- Clarification on libsqlite3-0 package in 18-build but no -dev package HOT 3
- Switch default branch from master to main HOT 1
- Question: Heroku-20 general release date HOT 4
- ImageMagick default resource limits are surprisingly low HOT 5
- Installation of gettext fails on heroku-20; heroku-18 is fine HOT 5
- Postgres 13
- The Heroku-20-Build Ruby version does not match the Heroku Platform Ruby. HOT 3
- ARM64 support for image HOT 20
- ImageMagick "area" resource limit should be in pixels ? HOT 3
- `SSL_read: unexpected eof while reading` using `redis-rb` on Heroku-22 HOT 3
- heroku/heroku:22 doesn't download standard library HOT 1
- Stack 22 breaks azure cognitive services package HOT 2
- env PYTHONHOME trigger import error HOT 1
- Deprecated usage of apt-key.
- Add missing CNB Labels
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from base-images.