diff --git a/build.sh b/build.sh index 8e0641538..adcc76a56 100755 --- a/build.sh +++ b/build.sh @@ -1,10 +1,19 @@ #!/bin/bash mkdir bin + docker run --rm -it \ -v $PWD:/go/src/github.com/polyverse/ropoly \ -w /go/src/github.com/polyverse/ropoly \ - golang + golang scripts/buildlibc.sh echo "Copying libc binary into bin..." cp ./ropoly ./bin/ropoly-libc-x86_64 + +docker run --rm -it \ + -v $PWD:/go/src/github.com/polyverse/ropoly \ + -w /go/src/github.com/polyverse/ropoly \ + golang:alpine scripts/buildmusl.sh + +echo "Copying musl binary into bin..." +cp ./ropoly ./bin/ropoly-musl-x86_64 diff --git a/scripts/buildmusl.sh b/scripts/buildmusl.sh new file mode 100755 index 000000000..18963765f --- /dev/null +++ b/scripts/buildmusl.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +echo "Building Ropoly inside Docker (Alpine)..." + +apk update +apk add curl bash alpine-sdk + +echo "Installing dep..." +curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh + +echo "Installing dependencies..." +dep ensure + +echo "Building..." +go build +