3 ms·
At lot of parts of this don't really make much sense: > As I’m looking for a way to build a container without having it host the whole build environment (such
by IanCal 12y ago
At lot of parts of this don't really make much sense:
> As I’m looking for a way to build a container without having it host the whole build environment (such as Puppet modules, ssh private keys to the Git repository, etc)
Why would you need to check out something from git within the container? That sounds like an unusual setup. Normally you'd check out your repo, then run a build from within it.
> A Dockerfile to build a container with a basic Ruby stack.
> A Dockerfile from #1 to build the deps: checkout the application on Github, install the packages, run bundle install, then remove the application. I’ll be able to share this container with both applications. Big win!
> A Dockerfile from #2 to download the application from Github, then setup everything. So my dependencies are already installed, and it goes fast every time I don’t need to update them.
Shouldn't this just be
Application with a dockerfile like this
ADD Gemfile
RUN bundle install
ADD .
Check out repo.
Run docker build.
That way it's all cached, and you don't repeatedly build the dependencies. Has the author not seen docker caching?