forked from fortio/fortio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.build
36 lines (36 loc) · 1.83 KB
/
Dockerfile.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Dependencies and linters for build:
FROM ubuntu:xenial
# Need gcc for -race test (and some linters though those work with CGO_ENABLED=0)
RUN apt-get -y update && \
apt-get --no-install-recommends -y upgrade && \
apt-get --no-install-recommends -y install ca-certificates curl make git gcc \
libc6-dev apt-transport-https ssh ruby-dev build-essential rpm
# Install FPM
RUN gem install --no-ri --no-rdoc fpm
# Install both go1.11 [go1.10.3] and go1.8.7 so we don't become incompatible with 1.8
RUN curl -f https://storage.googleapis.com/golang/go1.8.7.linux-amd64.tar.gz | tar xfz - -C /usr/local
# Newer go have no problem with being installed in random directories without requiring GOROOT so we
# leave the old go in /usr/local and put the new ones, despite being preferred, in a different root:
# No report of issues with 1.11 so far so skipping 1.10
#RUN mkdir /go1.10
#RUN curl -f https://dl.google.com/go/go1.10.4.linux-amd64.tar.gz | tar xfz - -C /go1.10
RUN mkdir /go1.11
RUN curl -f https://dl.google.com/go/go1.11.5.linux-amd64.tar.gz | tar xfz - -C /go1.11
ENV GOPATH /go
RUN mkdir -p $GOPATH/bin
# We do pick the latest go first in the path
ENV PATH /go1.11/go/bin:/usr/local/go/bin:$PATH:$GOPATH/bin
RUN go version # check it's indeed the version we expect
# This is now handled through dep and vendor submodule
# RUN go get -u google.golang.org/grpc
# Install dep
RUN curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
# Install meta linters
RUN go get -u github.com/alecthomas/gometalinter
RUN gometalinter -i -u
WORKDIR /go/src/fortio.org
# Docker:
RUN curl -fsSL "https://download.docker.com/linux/ubuntu/gpg" | apt-key add
RUN echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable" > /etc/apt/sources.list.d/docker.list
RUN apt-get -y update
RUN apt-get install --no-install-recommends -y docker-ce