问题描述
背景
我有一个名为apple
的Rails应用和一个名为seed
的依赖项的gem apple
。 1 seed
位于apple
作为git子模块的目录:
-
~/devel/apple
(Rails项目的根) -
~/devel/apple/seed
(gem根和apple
的gitsubmodule)
我通过Docker和docker-compose部署了apple
和seed
。这些进程被配置为忽略任何.git
目录。 git完全没有理由参与Docker构建过程。我只是将整个apple
目录复制到包含seed
的容器中。
问题
问题是,当Rails服务器(Puma)启动时,该过程的某些部分正在调用git rev-parse --verify master
,由于容器中不存在git存储库,因此这当然是行不通的。
在实际的Docker构建过程中,我很难为该错误获得良好的日志,但是我在主机上(有点)通过在master
中不包含seed
分支来重现了该错误(因此)。相同的git rev-parse
命令失败:
/bin/zsh -c "bash -c 'env RBENV_VERSION=2.7.1 /usr/local/Cellar/rbenv/1.1.2/libexec/rbenv exec ruby /Users/david/devel/apple/bin/rails server -b 0.0.0.0 -p 3000 -e development'"
Git error: command `git rev-parse --verify master` in directory /Users/david/devel/apple has failed.
Revision master does not exist in the repository git@github.com:myorganization/seed.git. Maybe you misspelled it?
If this error persists you could try removing the cache directory '/Users/david/devel/apple/seed'
Process finished with exit code 11
为什么在Rails服务器启动时会调用git rev-parse
,如何防止它,并且这样做安全吗?我不明白为什么需要git参与服务器启动,或者甚至参与我的docker构建过程。
1 不是实际名称;与这些名称的实际项目无关。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)