forked from decred/dcrdocker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-1.11
55 lines (44 loc) · 1.41 KB
/
Dockerfile-1.11
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#decred-golang-builder-1.11
# This image may be called with the run_tests.sh script included in any of the
# supported go repos.
# ./run_tests.sh 1.11
FROM golang:1.11.5
LABEL description="Decred golang builder image"
LABEL version="1.1"
LABEL maintainer "[email protected]"
ENV TERM linux
ENV USER build
# create user
RUN adduser --disabled-password --gecos '' $USER
# update base distro & install build tooling
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && \
apt-get install -qy rsync git xz-utils
# create directory for build artifacts, adjust user permissions
RUN mkdir /release && \
chown $USER /release
# create directory to get source from
RUN mkdir /src && \
chown $USER /src && \
mkdir -p /go/src/github.com/decred && \
chown -R $USER /go/src
# switch user
USER $USER
ENV HOME /home/$USER
#Get deps
ENV DEP_TAG v0.4.1
ENV GOMETALINTER_TAG v2.0.5
ENV GOLANGCI_TAG v1.13.1
WORKDIR /go/src
RUN git clone --branch $GOLANGCI_TAG https://github.com/golangci/golangci-lint && \
cd golangci-lint/cmd/golangci-lint && \
GO111MODULE=on go install && \
go get -v github.com/alecthomas/gometalinter && \
cd /go/src/github.com/alecthomas/gometalinter && \
git checkout $GOMETALINTER_TAG && \
go install -i && \
gometalinter --install && \
go get -v github.com/golang/dep && \
cd /go/src/github.com/golang/dep && \
git checkout $DEP_TAG && \
go install -i ./...