build-go.sh 807 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/sh
  2. # Build GO version as specified in Dockerfile
  3. set -x
  4. set -e
  5. # Components versions
  6. export GOLANG_VERSION="1.11"
  7. export GOLANG_SRC_URL="https://golang.org/dl/go$GOLANG_VERSION.src.tar.gz"
  8. export GOLANG_SRC_SHA256="558f8c169ae215e25b81421596e8de7572bd3ba824b79add22fba6e284db1117"
  9. # Install build tools
  10. apk add --no-cache --no-progress --virtual build-deps-go gcc musl-dev openssl go
  11. export GOROOT_BOOTSTRAP="$(go env GOROOT)"
  12. # Download Go
  13. wget -q "$GOLANG_SRC_URL" -O golang.tar.gz
  14. echo "$GOLANG_SRC_SHA256 golang.tar.gz" | sha256sum -c -
  15. tar -C /usr/local -xzf golang.tar.gz
  16. rm golang.tar.gz
  17. # Build
  18. cd /usr/local/go/src
  19. # See https://golang.org/issue/14851
  20. patch -p2 -i /app/gitote/build/docker/no-pic.patch
  21. ./make.bash
  22. # Clean
  23. rm /app/gitote/build/docker/*.patch
  24. apk del build-deps-go