Dockerfile 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. FROM debian:squeeze
  2. MAINTAINER Jakob Borg <[email protected]>
  3. ENV GOLANG_VERSION 1.3.3
  4. # SCMs for "go get", gcc for cgo
  5. RUN apt-get update && apt-get install -y \
  6. ca-certificates curl gcc libc6-dev make \
  7. bzr git mercurial unzip \
  8. --no-install-recommends \
  9. && apt-get clean \
  10. && rm -rf /var/lib/apt/lists/*
  11. # Get the binary dist of Go to be able to bootstrap gonative.
  12. RUN curl -sSL https://golang.org/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz \
  13. | tar -v -C /usr/local -xz
  14. ENV PATH /usr/local/go/bin:$PATH
  15. RUN mkdir /go
  16. ENV GOPATH /go
  17. ENV PATH /go/bin:$PATH
  18. WORKDIR /go
  19. # Use gonative to install native Go for most arch/OS combos
  20. RUN go get github.com/calmh/gonative \
  21. && cd /usr/local \
  22. && rm -rf go \
  23. && gonative -version $GOLANG_VERSION
  24. # Rebuild the special and missing versions
  25. RUN bash -xec '\
  26. cd /usr/local/go/src; \
  27. for platform in linux/386 freebsd/386 windows/386 linux/arm openbsd/amd64 openbsd/386; do \
  28. GOOS=${platform%/*} \
  29. GOARCH=${platform##*/} \
  30. GOARM=5 \
  31. GO386=387 \
  32. CGO_ENABLED=0 \
  33. ./make.bash --no-clean 2>&1; \
  34. done \
  35. && ./make.bash --no-clean \
  36. '
  37. # Install packages needed for test coverage
  38. RUN go get github.com/tools/godep \
  39. && go get code.google.com/p/go.tools/cmd/cover \
  40. && go get github.com/axw/gocov/gocov \
  41. && go get github.com/AlekSi/gocov-xml
  42. # Random build users needs to be able to create stuff in /go
  43. RUN chmod -R 777 /go/bin /go/pkg /go/src