Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

724
Views
Dockerfile cmd devuelve un error de integridad de Yarn pero la ejecución de Docker funciona bien

Estoy tratando de hacer que una aplicación de Rails 6 se ejecute en Docker. Cuando el servidor de rieles de comando se ejecuta desde el archivo docker, aparece un error.

 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.

En mi archivo config/webpacker.yml tengo esta línea:

 development: <<: *default check_yarn_integrity: false

En mi configuración/entornos/desarrollo.rb:

 config.webpacker.check_yarn_integrity = false

También estoy creando mis node_modules como parte de la configuración de la ventana acoplable (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"]

Ejecutar docker-compose run web rails s -b 0.0.0.0 funciona.

Ejecutar docker-compose up --build web devuelve el error.

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Puede comparar su Dockerfile + docker-compose.yml con este y ver si hay alguna diferencia (como usar RUN yarn install --check-files ) que haría desaparecer el mensaje de error.

Otro ejemplo ( Dockerfile + docker-compose.yml ) se usa en " Ejecutar una aplicación Rails con Webpacker y Docker " de Dirk de Kok

En ambos casos, la aplicación se inicia con docker-compose up .
Y han seguido, como usted, las recomendaciones del problema 1568 de rails/webpacker (con respecto a config.webpacker.check_yarn_integrity = false en config/environments/development.rb )

over 4 years ago · Santiago Trujillo Report

0

Funcionó hoy. No se cambió ningún código, simplemente decidió funcionar. Intenté ejecutar docker-compose run web rm -rf / para comenzar de nuevo, pero ignoró ese comando y luego comenzó a funcionar. Así es la vida. @vonc gracias por el esfuerzo, te recompensaré.

Editar: Volvió. Esta vez lo arreglé usando

 docker rm $(docker ps -a -q)

Advertencia: Esto destruye todos sus contenedores. No use esto si tiene datos dentro de sus volúmenes.

La causa del problema fue experimentar con la creación de un Dockerfile y la composición no borraba una capa del volumen. docker-compose run es diferente a docker-compose up porque run crea una nueva capa encima del volumen de docker para ejecutar el comando, esencialmente creando un nuevo contenedor. Docker mismo no pudo aplicar los cambios a una capa anterior.

over 4 years ago · Santiago Trujillo Report

0

hacer config.webpacker.check_yarn_integrity = false no es una buena idea.

Se produce por incompatibilidad de versiones.

tratar

 rails webpacker:install

debería resolver tu problema.


si no intenta

 $ rm yarn.lock $ yarn cache clean $ yarn install
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!