【发布时间】:2019-05-14 14:39:29
【问题描述】:
我正在尝试让 Rails 6 应用程序在 Docker 中运行。从 dockerfile 执行命令 rails server 时,出现错误。
remote: web_1_a59d968487d2 | warning Integrity check: System parameters don't match
remote: web_1_a59d968487d2 | error Integrity check failed
remote: web_1_a59d968487d2 | error Found 1 errors.
remote: web_1_a59d968487d2 |
remote: web_1_a59d968487d2 |
remote: web_1_a59d968487d2 | ========================================
remote: web_1_a59d968487d2 | Your Yarn packages are out of date!
remote: web_1_a59d968487d2 | Please run `yarn install --check-files` to update.
remote: web_1_a59d968487d2 | ========================================
remote: web_1_a59d968487d2 |
remote: web_1_a59d968487d2 |
remote: web_1_a59d968487d2 | To disable this check, please change `check_yarn_integrity`
remote: web_1_a59d968487d2 | to `false` in your webpacker config file (config/webpacker.yml).
remote: web_1_a59d968487d2 |
remote: web_1_a59d968487d2 |
remote: web_1_a59d968487d2 | yarn check v1.16.0
remote: web_1_a59d968487d2 | info Visit https://yarnpkg.com/en/docs/cli/check for documentation about this command.
在我的 config/webpacker.yml 文件中有这一行:
development:
<<: *default
check_yarn_integrity: false
在我的 config/environments/development.rb 中:
config.webpacker.check_yarn_integrity = false
我还在构建我的 node_modules 作为 docker setup (Dockerfile) 的一部分:
FROM ruby:2.6.3
RUN apt-get update && apt-get install apt-transport-https
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update -qq && apt-get install -y nodejs yarn
RUN mkdir /myapp
WORKDIR /myapp
COPY Gemfile /myapp/Gemfile
COPY Gemfile.lock /myapp/Gemfile.lock
RUN bundle install
COPY . /myapp
RUN rm -Rf node_modules/
RUN rm yarn.lock
RUN yarn install
ENV RAILS_ENV=development
EXPOSE 3000
# Start the main process.
CMD ["rails", "server", "-b", "0.0.0.0"]
运行docker-compose run web rails s -b 0.0.0.0 有效。
运行 docker-compose up --build web 返回错误。
【问题讨论】:
标签: ruby-on-rails docker yarnpkg