Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ different contents. If both are specified, `--force` takes precedence.

* `--cache` - use build caching to speed up builds
* `--parallel` - use multi-stage builds to install gems and node modules in parallel
* `--nproc n` - run bundle install in parallel
* `--nproc` - run bundle install in parallel

### Add/remove a Feature:

Expand Down
4 changes: 2 additions & 2 deletions lib/generators/dockerfile_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class DockerfileGenerator < Rails::Generators::Base
"mysql" => false,
"nginx" => false,
"parallel" => false,
"nproc" => 1,
"nproc" => false,
"passenger" => false,
"platform" => nil,
"postgresql" => false,
Expand Down Expand Up @@ -149,7 +149,7 @@ class DockerfileGenerator < Rails::Generators::Base
class_option :parallel, type: :boolean, default: OPTION_DEFAULTS.parallel,
desc: "use build stages to install gems and node modules in parallel"

class_option :nproc, type: :numeric, default: OPTION_DEFAULTS.nproc,
class_option :nproc, type: :boolean, default: OPTION_DEFAULTS.nproc,
desc: "run bundle install in parallel"

class_option :swap, type: :string, default: OPTION_DEFAULTS.swap,
Expand Down
4 changes: 2 additions & 2 deletions lib/generators/templates/Dockerfile.erb
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ ENV <%= build_env.join(" \\\n ") %>
<% end -%>
# Install application gems
COPY<% if options.link? %> --link<% end %> Gemfile Gemfile.lock <% if references_ruby_version_file? %><%= ruby_version_file %> <% end %>./
<% if options.nproc > 1 -%>
ENV MAKE="make -j<%= options.nproc %>"
<% if options.nproc -%>
ENV MAKE="make -j$(nproc)"
<% end -%>
<% if @netpopbug && Rails.env != "test" -%>
RUN sed -i "/net-pop (0.1.2)/a\ net-protocol" Gemfile.lock
Expand Down