forked from decred/dcrd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile-1.10
52 lines (41 loc) · 1.26 KB
/
Dockerfile-1.10
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
#decred-golang-builder-1.10
# This image may be called with the run_tests.sh script included in any of the
# supported go repos.
# ./run_tests.sh 1.10
FROM golang:1.10
LABEL description="Decred golang builder image"
LABEL version="1.0"
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
# 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 && \
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
WORKDIR /go/src
RUN go get -v github.com/alecthomas/gometalinter && \
cd /go/src/github.com/alecthomas/gometalinter && \
git checkout $GOMETALINTER_TAG && \
go install && \
gometalinter --install && \
go get -v github.com/golang/dep && \
cd /go/src/github.com/golang/dep && \
git checkout $DEP_TAG && \
go install -i