-
-
Save vdeturckheim/d420310e272f525824d7e92e7e875024 to your computer and use it in GitHub Desktop.
Crash when loading a native dep in Node.js on alpine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:10.19-alpine | |
WORKDIR code | |
COPY . . | |
RUN npm install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "test", | |
"version": "1.0.0", | |
"description": "", | |
"main": "test.js", | |
"scripts": { | |
}, | |
"keywords": [], | |
"author": "", | |
"license": "ISC", | |
"dependencies": { | |
"grpc": "^1.24.2" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker build . -t test_node_alpine | |
docker run test_node_alpine node test.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
try { | |
require('grpc'); | |
} | |
catch(e) { | |
console.log(e); | |
} | |
console.log('process did not crash'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment