forked from portworx/torpedo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
52 lines (40 loc) · 1.28 KB
/
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
43
44
45
46
47
48
49
50
51
52
FROM golang:1.12.10-alpine AS build
LABEL maintainer="[email protected]"
WORKDIR /go/src/github.com/portworx/torpedo
# Install setup dependencies
RUN apk update && \
apk add git gcc musl-dev && \
apk add make && \
apk add openssh-client && \
go get github.com/onsi/ginkgo/ginkgo && \
go get github.com/onsi/gomega && \
go get github.com/sirupsen/logrus
# No need to copy *everything*. This keeps the cache useful
COPY deployments deployments
COPY drivers drivers
COPY pkg pkg
COPY scripts scripts
COPY tests tests
COPY vendor vendor
COPY Makefile Makefile
# Why? Errors if this is removed
COPY .git .git
# Compile
RUN mkdir bin && \
make build
# Build a fresh container with just the binaries
FROM alpine
RUN apk add ca-certificates
# Install kubectl from Docker Hub.
COPY --from=lachlanevenson/k8s-kubectl:latest /usr/local/bin/kubectl /usr/local/bin/kubectl
# Copy scripts into container
WORKDIR /torpedo
COPY deployments deployments
COPY scripts scripts
WORKDIR /go/src/github.com/portworx/torpedo
# Copy ginkgo & binaries over from previous container
COPY --from=build /go/bin/ginkgo /bin/ginkgo
COPY --from=build /go/src/github.com/portworx/torpedo/bin bin
COPY drivers drivers
ENTRYPOINT ["ginkgo", "--failFast", "--slowSpecThreshold", "180", "-v", "-trace"]
CMD []