knex种子不在docker环境中工作

我为一些REST API使用nodejsknex 。 我使用这个代码来运行迁移种子

knex.migrate.latest() .then(() => { return knex.seed.run(); }) .then(() => { // migrations are finished, init server }); 

我正在使用远程 数据库进行此testing。 当我使用node index.js本地主机运行它时,它运行良好,迁移运行,然后数据库填充种子。 但是,当我创build一个Docker镜像并运行它时, 迁移按预期工作,但种子失败。 日志输出如下:

 Segmentation fault npm ERR! code ELIFECYCLE npm ERR! errno 139 npm ERR! com.app@0.2.0 start: `ENV=prod node index.js` npm ERR! Exit status 139 npm ERR! npm ERR! Failed at the com.app@0.2.0 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2017-11-12T12_20_43_664Z-debug.log 

问题是我无法到达容器imediatelly停止日志文件。

那么,有什么build议呢?

如果问题是你不能看到日志进一步诊断,也许你可以看看这些日志logging方法之一

看起来问题是Docker镜像中没有正确安装库。 该库是Bcrypt(我在种子文件中使用它来散列一些永久用户的密码)。 所以我最终改变了与bryptjs bcrypt ,现在docker的图像生成并正确运行。