-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: build alpine binary inside an alpine container
This is needed as building a node10 alpine binary on a linux platform generates a bad binary which segfaults. Reason is unclear, this is a workaround.
- Loading branch information
Anton Drukh
committed
Jul 20, 2019
1 parent
a7c6001
commit 7a6afde
Showing
2 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/sh | ||
|
||
# echo commands for debug purposes | ||
set -x | ||
# bail out in case of a single command failure | ||
set -e | ||
|
||
# this script is expected to run inside a node:alpine docker container | ||
# with the path /snyk mounted with the project folder | ||
cd /snyk | ||
npm install # install deps in case they are missing | ||
npm run prepare # explicit, as running as root would skip scripts | ||
|
||
# build the binary | ||
npm i -g pkg | ||
pkg . -t node10-alpine-x64 -o snyk-alpine | ||
|
||
# test it for validity | ||
./snyk-alpine -v |