Skip to content

Instantly share code, notes, and snippets.

@vdeturckheim
Last active March 24, 2020 09:28
Show Gist options
  • Save vdeturckheim/d420310e272f525824d7e92e7e875024 to your computer and use it in GitHub Desktop.
Save vdeturckheim/d420310e272f525824d7e92e7e875024 to your computer and use it in GitHub Desktop.
Crash when loading a native dep in Node.js on alpine
FROM node:10.19-alpine
WORKDIR code
COPY . .
RUN npm install
{
"name": "test",
"version": "1.0.0",
"description": "",
"main": "test.js",
"scripts": {
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"grpc": "^1.24.2"
}
}
docker build . -t test_node_alpine
docker run test_node_alpine node test.js
'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