-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
42 lines (30 loc) · 909 Bytes
/
Dockerfile
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
FROM fedora:latest
MAINTAINER Arun Neelicattu <[email protected]>
RUN dnf -y upgrade
# install base requirements
RUN dnf -y install golang git hg
# prepare gopath
ENV GOPATH /go
ENV PATH /go/bin:${PATH}
RUN mkdir -p ${GOPATH}
ENV PACKAGE github.com/google/cayley
ENV VERSION f143602b
ENV GO_BUILD_TAGS netgo
ENV CGO_ENABLED 0
RUN go get github.com/tools/godep
RUN go get ${PACKAGE}
WORKDIR ${GOPATH}/src/${PACKAGE}
RUN git checkout ${VERSION}
RUN godep restore
RUN GOPATH=`godep path`:${GOPATH} go build \
-tags "${GO_BUILD_TAGS}" \
-ldflags "-s -w -X ${PACKAGE}/version.Version ${VERSION}" \
-v -a -installsuffix cgo \
-o ./cayley \
./cmd/cayley
RUN rm -rf ./data/*
RUN mkdir tmp log
RUN rm -f ${PWD}/Dockerfile
COPY Dockerfile.final ./Dockerfile
COPY Dockerfile.final /gopath/bin/Dockerfile
CMD docker build -t docker.io/alectolytic/cayley ${PWD}