title: Yarn executable was not detected in the system
body: <p>Rails with docker gives me error when asset precompiled.
  i am trying to setup rails application with docker. everything is fine but asset precompiled issue raise during build image.</p>
  <pre><code>Yarn executable was not detected in the system.
  </code></pre>
  <h2>Dcoker file</h2>
  <blockquote>
  </blockquote>
  <pre><code>`FROM ruby:2.7.2
  ENV RAILS_ROOT /var/www/quickcard
  ENV BUNDLE_VERSION 2.1.4
  ENV BUNDLE_PATH usr/local/bundle/gems
  ENV RAILS_LOG_TO_STDOUT true
  ENV RAILS_PORT 5000
  COPY ./entrypoint.sh /usr/local/bin/entrypoint.sh
  RUN chmod +x /usr/local/bin/entrypoint.sh
  RUN apt-get update -qq &amp;&amp; apt-get install -y build-essential \
  git \
  libxml2-dev \
  libpq-dev \
  libxslt-dev \
  nodejs \
  yarn \
  imagemagick \
  tzdata \
  less \
  &amp;&amp; rm -rf /var/cache/apk/*
  RUN gem install bundler --version &quot;$BUNDLE_VERSION&quot;
  RUN bundle config set path $BUNDLE_PATH
  RUN mkdir -p $RAILS_ROOT
  WORKDIR $RAILS_ROOT
  ADD Gemfile Gemfile
  ADD Gemfile.lock Gemfile.lock
  COPY yarn.lock yarn.lock
  RUN bundle install
  EXPOSE $RAILS_PORT
  RUN ln -s $RAILS_ROOT/config/systemd/puma.service /etc/systemd/system/quickcard
  COPY . .
  ENTRYPOINT [&quot;entrypoint.sh&quot;]
  RUN bundle exec rake assets:precompile
  CMD [&quot;bundle&quot;, &quot;exec&quot;, &quot;puma&quot;, &quot;-C&quot;, &quot;config/puma.rb&quot;]
  
  
  `
  </code></pre>
  <p>How to resolve this error?</p>