syncthing/docker/Dockerfile

61 lines
1.7 KiB
Docker
Raw Normal View History

2014-11-23 20:46:18 +00:00
FROM debian:squeeze
MAINTAINER Jakob Borg <jakob@nym.se>
ENV GOLANG_VERSION 1.4rc2
2014-11-19 11:02:47 +00:00
# SCMs for "go get", gcc for cgo
RUN apt-get update && apt-get install -y \
ca-certificates curl gcc libc6-dev make \
bzr git mercurial unzip \
--no-install-recommends \
2014-11-23 20:46:18 +00:00
&& apt-get clean \
2014-11-19 11:02:47 +00:00
&& rm -rf /var/lib/apt/lists/*
# Get the binary dist of Go to be able to bootstrap gonative.
2014-11-23 20:46:18 +00:00
RUN curl -sSL https://golang.org/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz \
2014-11-19 11:02:47 +00:00
| tar -v -C /usr/local -xz
ENV PATH /usr/local/go/bin:$PATH
RUN mkdir /go
ENV GOPATH /go
ENV PATH /go/bin:$PATH
WORKDIR /go
# Use gonative to install native Go for most arch/OS combos
2014-11-23 20:46:18 +00:00
RUN go get github.com/calmh/gonative \
&& cd /usr/local \
2014-11-19 11:02:47 +00:00
&& rm -rf go \
&& gonative -version $GOLANG_VERSION
# Rebuild the special and missing versions
RUN bash -xec '\
cd /usr/local/go/src; \
for platform in linux/386 freebsd/386 windows/386 linux/arm openbsd/amd64 openbsd/386; do \
GOOS=${platform%/*} \
GOARCH=${platform##*/} \
GOARM=5 \
GO386=387 \
CGO_ENABLED=0 \
./make.bash --no-clean 2>&1; \
done \
2014-11-23 20:46:18 +00:00
&& ./make.bash --no-clean \
2014-11-19 11:02:47 +00:00
'
# Install packages needed for test coverage
2014-11-23 20:46:18 +00:00
RUN go get github.com/tools/godep \
&& go get golang.org/x/tools/cmd/cover \
2014-11-23 20:46:18 +00:00
&& go get github.com/axw/gocov/gocov \
&& go get github.com/AlekSi/gocov-xml
2014-11-19 11:02:47 +00:00
2014-11-29 23:30:23 +00:00
# Build standard library for race
RUN go install -race std
2014-11-23 21:30:29 +00:00
# Random build users needs to be able to create stuff in /go
RUN chmod -R 777 /go/bin /go/pkg /go/src