File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
railties/lib/rails/generators Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -540,6 +540,11 @@ def dockerfile_yarn_version
540
540
"latest"
541
541
end
542
542
543
+ def yarn_through_corepack?
544
+ true if dockerfile_yarn_version == "latest"
545
+ dockerfile_yarn_version >= "2"
546
+ end
547
+
543
548
def dockerfile_bun_version
544
549
using_bun? and `bun --version` [ /\d +\. \d +\. \d +/ ]
545
550
rescue
Original file line number Diff line number Diff line change @@ -38,10 +38,17 @@ RUN apt-get update -qq && \
38
38
ARG NODE_VERSION=<%= node_version %>
39
39
ARG YARN_VERSION=<%= dockerfile_yarn_version %>
40
40
ENV PATH=/usr/local/node/bin:$PATH
41
+ <% if yarn_through_corepack? -%>
42
+ RUN curl -sL https://github.com/nodenv/node-build/archive/master.tar.gz | tar xz -C /tmp/ && \
43
+ /tmp/node-build-master/bin/node-build "${NODE_VERSION}" /usr/local/node && \
44
+ rm -rf /tmp/node-build-master
45
+ RUN corepack enable && yarn set version $YARN_VERSION
46
+ <% else -%>
41
47
RUN curl -sL https://github.com/nodenv/node-build/archive/master.tar.gz | tar xz -C /tmp/ && \
42
48
/tmp/node-build-master/bin/node-build "${NODE_VERSION}" /usr/local/node && \
43
49
npm install -g yarn@$YARN_VERSION && \
44
50
rm -rf /tmp/node-build-master
51
+ <% end -%>
45
52
46
53
<% end -%>
47
54
<% if using_bun? -%>
@@ -61,7 +68,7 @@ RUN bundle install && \
61
68
<% if using_node? -%>
62
69
# Install node modules
63
70
COPY package.json yarn.lock ./
64
- RUN yarn install --frozen-lockfile
71
+ RUN yarn install --immutable
65
72
66
73
<% end -%>
67
74
<% if using_bun? -%>
You can’t perform that action at this time.
0 commit comments