FROM ubuntu:latest

RUN apt-get update && \
    apt-get install -y --no-install-recommends git python-pip zip jq wget && \
    pip install --upgrade pip && \
    apt-get clean
RUN pip install setuptools && pip install awscli

RUN cd /tmp && \
    wget -nv https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz && \
    ( \
        echo '1862f4c3d3907e59b04a757cfda0ea7aa9ef39274af99a784f5be843c80c6772 go1.8.3.linux-amd64.tar.gz' | \
        sha256sum -c - \
    ) && \
    tar -C /usr/local -xzf go*.tar.gz && \
    rm go*.tar.gz

RUN mkdir -p /opt/go
ENV GOPATH /opt/go
ENV PATH /usr/local/go/bin:/opt/go/bin:$PATH

RUN go get github.com/onsi/ginkgo/ginkgo && go get github.com/golang/lint/golint
FROM ubuntu:xenial

# install base utils {
RUN apt-get update \
  && apt-get install -y --no-install-recommends \
    curl \
    git \
    jq \
    python3-pip \
    python3-setuptools \
    wget \
    zip \
  && pip3 install awscli \
  && apt-get autoremove \
  && apt-get clean \
  && rm -rf /var/lib/apt/lists/*
# }

# golang {
WORKDIR /usr/local

RUN \
  GO_INFO=$(curl 'https://golang.org/dl/?mode=json' | jq '.[0].files[] | select(.os == "linux" and .arch == "amd64")') && \
  GO_TAR="$(echo "$GO_INFO" | jq -r '.filename')" && \
  GO_SHA="$(echo "$GO_INFO" | jq -r '.sha256')" && \
  curl -fSL https://storage.googleapis.com/golang/$GO_TAR -o $GO_TAR \
  && echo $GO_SHA $GO_TAR | sha256sum -c - \
  && tar -xzf $GO_TAR \
  && rm -f $GO_TAR

ENV \
  PATH=/usr/local/go/bin:$PATH \
  GOPATH=/root/go \
  GOROOT=/usr/local/go
# }

# install go packages {
RUN \
  go get github.com/onsi/ginkgo/ginkgo \
  && go get github.com/golang/lint/golint
# }

Update golang in s3cli docker image
Update golang in s3cli docker image

- also pin ubuntu version to xenial instead of latest

[#156582073](https://www.pivotaltracker.com/story/show/156582073)
