forked from decred/dcrd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-1.8
51 lines (41 loc) · 1.31 KB
/
Dockerfile-1.8
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
#decred-golang-builder-1.8
FROM golang:1.8.3
LABEL description="Decred golang builder image"
LABEL version="1.0"
LABEL maintainer "john@netpurgatory.com"
ENV TERM linux
ENV USER build
# create user
RUN adduser --disabled-password --gecos '' build
# update base distro & install build tooling
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && \
apt-get install -qy rsync
# 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/dcrd && \
mkdir -p /go/src/github.com/decred/dcrwallet && \
mkdir -p /go/src/github.com/decred/dcrctl && \
mkdir -p /go/src/github.com/decred/dcrrpcclient && \
chown -R $USER /go/src/github.com/decred
# switch user
USER $USER
ENV HOME /home/$USER
#Get deps
ENV GLIDE_TAG v0.12.3
ENV GOMETALINTER_TAG v1.2.1
WORKDIR /go/src
RUN go get -v github.com/Masterminds/glide && \
cd /go/src/github.com/Masterminds/glide && \
git checkout $GLIDE_TAG && \
make build && \
mv glide `which glide` && \
go get -v github.com/alecthomas/gometalinter && \
cd /go/src/github.com/alecthomas/gometalinter && \
git checkout $GOMETALINTER_TAG && \
go install && \
gometalinter --install