Node 6.2.2 & node.bcrypt.js

未關閉
#206 4 則留言 5 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
25/100
Issue 類型
文件
描述清晰度
需要釐清
活躍度
停滯
技術堆疊
docker, docker-compose, nodejs

研究方向

未指定任何 repository 檔案或測試。檢查 Node 6.2.2 映像的文件以及 Dockerfile 或 Docker Compose 入口點,然後在 npm start 之前執行 npm rebuild,以驗證文件中說明的 bcrypt 因應措施;當指南清楚說明掛載 node_modules 的情況時,即視為完成。

由索引模型根據 Issue 內容生成。

描述

docs

When using bcrypt with this image you may run into a problem if you are mounting your local node_modules folder into your docker container. There may be times when you need to recompile C++ addons (which bcrypt has). So, to do this make sure that before your container starts executing code to run npm rebuild link.

I do this by building my container and then execing into it. I then manually run npm rebuild as I haven't found a better way to do this yet.

I hope this saves somebody else the hour I wasted trying to figure this out.

Edit
So an easier solution for docker compose is command: bash -c "npm rebuild && npm start" assuming npm start kicks off your server. This same method can be applied to a Dockerfile or the command line.

Edit2
Another, albeit uglier, solution is to mount the Host machines g++ compiler:

/usr/lib/x86_64-linux-gnu/:/usr/lib/x86_64-linux-gnu/

主要語言
Dockerfile
星號
8.6k
分支
2k
平均合併
10 小時 19 分鐘
30 天內合併 PR
16

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

nodejs/docker-node 的其他 Issue

查看 nodejs/docker-node 的全部 Issue

相似的 Issue

更多 DevOps Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。