FROM ubuntu:trusty

ARG GO_VERSION
ARG GO_SHA256

ENV PATH=/usr/local/go/bin:/go/bin:$PATH

# Update should be kept together with install; it forces a docker cache break when we alter packages
RUN apt-get update && apt-get install -y \
	wget            \
	git             \
	build-essential \
	curl            \
	pkg-config      \
	python-pip      \
	python3-pip

# Install Golang
RUN curl -s -LO "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz"
RUN echo "${GO_SHA256}  go${GO_VERSION}.linux-amd64.tar.gz" | sha256sum --check
RUN tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz
RUN rm go${GO_VERSION}.linux-amd64.tar.gz

# Install binaries into a secondary directory
ENV GOPATH=/go
RUN go get github.com/alecthomas/gometalinter
RUN go get github.com/axw/gocov/gocov
RUN go get github.com/t-yuki/gocov-xml
RUN go get github.com/jstemmer/go-junit-report
RUN gometalinter --install

RUN pip3 install awscli
