{"action":"created","issue":{"url":"https://api.github.com/repos/nodejs/docker-node/issues/206","repository_url":"https://api.github.com/repos/nodejs/docker-node","labels_url":"https://api.github.com/repos/nodejs/docker-node/issues/206/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/docker-node/issues/206/comments","events_url":"https://api.github.com/repos/nodejs/docker-node/issues/206/events","html_url":"https://github.com/nodejs/docker-node/issues/206","id":162308547,"number":206,"title":"Node 6.2.2 & node.bcrypt.js","user":{"login":"adam-beck","id":6046654,"avatar_url":"https://avatars.githubusercontent.com/u/6046654?v=3","gravatar_id":"","url":"https://api.github.com/users/adam-beck","html_url":"https://github.com/adam-beck","followers_url":"https://api.github.com/users/adam-beck/followers","following_url":"https://api.github.com/users/adam-beck/following{/other_user}","gists_url":"https://api.github.com/users/adam-beck/gists{/gist_id}","starred_url":"https://api.github.com/users/adam-beck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adam-beck/subscriptions","organizations_url":"https://api.github.com/users/adam-beck/orgs","repos_url":"https://api.github.com/users/adam-beck/repos","events_url":"https://api.github.com/users/adam-beck/events{/privacy}","received_events_url":"https://api.github.com/users/adam-beck/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-06-26T02:04:55Z","updated_at":"2016-06-28T14:24:59Z","closed_at":null,"body":"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](https://docs.npmjs.com/cli/rebuild). \r\n\r\nI do this by building my container and then `exec`ing into it. I then manually run `npm rebuild` as I haven't found a better way to do this yet.\r\n\r\nI hope this saves somebody else the hour I wasted trying to figure this out. \r\n\r\n**Edit**\r\nSo 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.\r\n\r\n**Edit2**\r\nAnother, albeit uglier, solution is to mount the Host machines g++ compiler:\r\n\r\n`/usr/lib/x86_64-linux-gnu/:/usr/lib/x86_64-linux-gnu/`"},"comment":{"url":"https://api.github.com/repos/nodejs/docker-node/issues/comments/229065133","html_url":"https://github.com/nodejs/docker-node/issues/206#issuecomment-229065133","issue_url":"https://api.github.com/repos/nodejs/docker-node/issues/206","id":229065133,"user":{"login":"adam-beck","id":6046654,"avatar_url":"https://avatars.githubusercontent.com/u/6046654?v=3","gravatar_id":"","url":"https://api.github.com/users/adam-beck","html_url":"https://github.com/adam-beck","followers_url":"https://api.github.com/users/adam-beck/followers","following_url":"https://api.github.com/users/adam-beck/following{/other_user}","gists_url":"https://api.github.com/users/adam-beck/gists{/gist_id}","starred_url":"https://api.github.com/users/adam-beck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adam-beck/subscriptions","organizations_url":"https://api.github.com/users/adam-beck/orgs","repos_url":"https://api.github.com/users/adam-beck/repos","events_url":"https://api.github.com/users/adam-beck/events{/privacy}","received_events_url":"https://api.github.com/users/adam-beck/received_events","type":"User","site_admin":false},"created_at":"2016-06-28T14:24:59Z","updated_at":"2016-06-28T14:24:59Z","body":"@chorrell I don't think this is specific to v6.2.2. I'm not for sure how to change the Dockerfile so that it will run the `npm rebuild` command at the correct time (because the directory is a mounted volume). I tried modifiying this one and ran `RUN npm rebuild` right before the `CMD [ \"node\" ]`. That doesn't work.\r\n\r\nI did mention how when using this Dockerfile you can use the command `bash -c \"npm rebuild && npm start\"`. This issue was more or less created for documentation. "}}
{"actor":{"display_login":"adam-beck"}}