build-go.sh 698 B

123456789101112131415161718192021222324252627282930
  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.8"
  7. export GOLANG_SRC_URL="https://golang.org/dl/go$GOLANG_VERSION.src.tar.gz"
  8. export GOLANG_SRC_SHA256="406865f587b44be7092f206d73fc1de252600b79b3cacc587b74b5ef5c623596"
  9. # Install build tools
  10. export GOROOT_BOOTSTRAP="$(go env GOROOT)"
  11. # Download Go
  12. wget -q "$GOLANG_SRC_URL" -O golang.tar.gz
  13. echo "$GOLANG_SRC_SHA256 golang.tar.gz" | sha256sum -c -
  14. tar -C /usr/local -xzf golang.tar.gz
  15. rm golang.tar.gz
  16. # Build
  17. cd /usr/local/go/src
  18. # see https://golang.org/issue/14851
  19. patch -p2 -i /app/gogs/build/docker/no-pic.patch
  20. ./make.bash
  21. # Clean
  22. rm /app/gogs/build/docker/*.patch