blob: b23f9e6b1a5fec16546c788bfd2879eb4a1b71fc [file] [log] [blame]
David K. Bainbridgebba65ff2018-01-19 09:26:09 -08001# Copyright 2018 the original author or authors.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
Sergio Slobodrian6f5fc4c2017-11-17 15:31:12 -050015FROM golang:1.9.2
Sergio Slobodrianbe829272017-07-17 14:45:45 -040016MAINTAINER Alex Peters <info@alexanderpeters.de>
17
Gertjan Van Droogenbroecke0c9acb2017-11-16 16:54:22 +010018RUN apt-get update && apt-get install -y apt-transport-https ca-certificates jq curl gnupg2 software-properties-common
Sergio Slobodrianbe829272017-07-17 14:45:45 -040019
Gertjan Van Droogenbroecke0c9acb2017-11-16 16:54:22 +010020RUN curl -fsSL https://download.docker.com/linux/$(. /etc/os-release; echo "$ID")/gpg | apt-key add -
21RUN add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") $(lsb_release -cs) stable"
Sergio Slobodrianbe829272017-07-17 14:45:45 -040022
Gertjan Van Droogenbroecke0c9acb2017-11-16 16:54:22 +010023RUN apt-get update && apt-cache policy docker-ce && apt-get install -y upx-ucl docker-ce && apt-get clean
Sergio Slobodrianbe829272017-07-17 14:45:45 -040024
25RUN go get github.com/pwaller/goupx \
26 && go get golang.org/x/tools/cmd/cover \
27 && go get -u github.com/golang/lint/golint \
28 && go get github.com/kisielk/errcheck \
29 && go get github.com/cespare/prettybench \
30 && go get github.com/uber/go-torch
31
32# Install dependency management tools
33# gpm
34RUN wget https://raw.githubusercontent.com/pote/gpm/v1.3.2/bin/gpm -O /usr/local/bin/gpm && \
35 chmod +x /usr/local/bin/gpm
36
37# glide
38ENV glide_version=v0.12.3
39RUN mkdir -p bin ; \
40 curl -L https://github.com/Masterminds/glide/releases/download/${glide_version}/glide-${glide_version}-linux-amd64.tar.gz | \
41 tar -xz -C bin ; \
42 mv bin/linux-amd64/glide bin/glide; \
43 rm -rf bin/linux-amd64
44
45
46ARG GITHUB_TOKEN
47RUN echo "machine github.com login $GITHUB_TOKEN" >/root/.netrc
48
49COPY build_environment.sh /
50COPY build.sh /
51
52VOLUME /src
53WORKDIR /src
54
55ENV GORACE="halt_on_error=1"
56
57ENTRYPOINT ["/build.sh"]