5 ms·
If I understood correctly, this means that every time you add a new dependency, it takes 15 minutes to rebuild the first time you `docker-compose up` right? I
by ahmedfromtunis 6y ago
If I understood correctly, this means that every time you add a new dependency, it takes 15 minutes to rebuild the first time you `docker-compose up` right?
I assume this is due to docker downloading the related image and running the container.
If this is the case, isn't this orders of magnitude faster than adding the dependency manually. And aren't the gains are even more significant when we factor the fact that most of the cases dev and prod environments are identical? Or am I missing something?
- save_ferris 6y ago> this means that every time you add a new dependency, it takes 15 minutes to rebuild the first time you `docker-compose up` right? Yes > If this is the case, isn't this orders of magnitude faster than adding the dependency manually. No. When developing a rails server running locally, you just need to install the new dependency via bundle install (usually takes just a few seconds) and then your server is ready to run again. With docker, the image needs to be entirely rebuilt, which is a much slower process, even with good caching. The difference is that docker treats the build as ephemeral and willing to be thrown away and rebuilt, as opposed to running directly, which simply augments the existing environment. It’s a much, much slower process to rebuild via docker.
- deleted 6y ago[deleted]
- ClikeX 6y agoAdding Ruby dependencies (gems) is pretty trivial. And the Ruby package manager (bundler) only installs the new dependency if you do it on your own machine. In Docker it will do all of them. It's worth noting that bundle uses a Gemfile, so it's not installing each Gem as a seperate step.