Skip to content

Instantly share code, notes, and snippets.

@Eun
Created October 9, 2018 10:33
Show Gist options
  • Save Eun/1d532bec3168cd9ad3f2125384c97590 to your computer and use it in GitHub Desktop.
Save Eun/1d532bec3168cd9ad3f2125384c97590 to your computer and use it in GitHub Desktop.
cross compile golang using alpine
#!/bin/bash
PWD=$(pwd)
if [ -n "${PWD##*$GOPATH*}" ]; then
echo "$PWD not in $GOPATH"
exit 1
fi
P=${PWD:${#GOPATH}}
P=/go/${P#/}
docker run --rm -it --volume $PWD:$P -w $P golang:1.10.3-alpine sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment