【发布时间】:2016-06-20 16:57:58
【问题描述】:
在 Docker 容器中使用 Rails 时 severalposts,(包括one on docker.com)使用以下模式:
- 在
Dockerfile中执行ADD Gemfile和ADD Gemfile.lock,然后在RUN bundle install中。 - 使用
docker-compose run web rails new创建一个新的Rails 应用程序。
由于我们是RUN bundle install来构建镜像的,所以更新Gemfile之后似乎适合docker-compose build web。
这是因为 gemset 将在图像中更新,但是:
Docker 主机上的Gemfile.lock不会更新以反映对Gemfile 的更改。这是一个问题,因为:
Gemfile.lockshould be in your repository,以及:它应该与您当前的
Gemfile一致。
所以:
如何更新主机上的Gemfile.lock,以便将其签入版本控制?
【问题讨论】:
标签: ruby-on-rails docker bundler