File: Dockerfile

package info (click to toggle)
gotest.tools 2.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 656 kB
  • sloc: sh: 17; makefile: 8
file content (53 lines) | stat: -rw-r--r-- 1,569 bytes parent folder | download
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

ARG     GOLANG_VERSION
FROM    golang:${GOLANG_VERSION:-1.11-alpine} as golang
RUN     apk add -U curl git bash
WORKDIR /go/src/gotest.tools
ENV     CGO_ENABLED=0
ENV     PS1="# "


FROM    golang as tools
ARG     FILEWATCHER=v0.3.2
RUN     go get -d github.com/dnephin/filewatcher && \
        cd /go/src/github.com/dnephin/filewatcher && \
        git checkout -q "$FILEWATCHER" && \
        go build -o /usr/bin/filewatcher .

ARG     DEP_TAG=v0.4.1
RUN     go get -d github.com/golang/dep/cmd/dep && \
        cd /go/src/github.com/golang/dep && \
        git checkout -q "$DEP_TAG" && \
        go build -o /usr/bin/dep ./cmd/dep

ARG     GOTESTSUM=v0.3.2
RUN     go get -d gotest.tools/gotestsum && \
        cd /go/src/gotest.tools/gotestsum && \
        git checkout -q "$GOTESTSUM" && \
        go build -v -o /usr/bin/gotestsum .


FROM    golang as dev
COPY    --from=tools /usr/bin/filewatcher /usr/bin/filewatcher
COPY    --from=tools /usr/bin/dep /usr/bin/dep
COPY    --from=tools /usr/bin/gotestsum /usr/bin/gotestsum


FROM    dev as dev-with-source
COPY    . .


FROM    golang as linter
ARG     GOMETALINTER=v2.0.11
RUN     go get -d github.com/alecthomas/gometalinter && \
        cd /go/src/github.com/alecthomas/gometalinter && \
        git checkout -q "$GOMETALINTER" && \
        go build -v -o /usr/local/bin/gometalinter . && \
        gometalinter --install && \
        rm -rf /go/src/* /go/pkg/*
ENTRYPOINT ["/usr/local/bin/gometalinter"]
CMD     ["--config=.gometalinter.json", "./..."]


FROM    linter as linter-with-source
COPY    . .