forked from openfaas/faas-swarm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
30 lines (19 loc) · 796 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
FROM golang:1.9.2
RUN mkdir -p /go/src/github.com/openfaas/faas-swarm/
WORKDIR /go/src/github.com/openfaas/faas-swarm
COPY vendor vendor
COPY handlers handlers
COPY server.go .
RUN curl -sL https://github.com/alexellis/license-check/releases/download/0.2.2/license-check > /usr/bin/license-check \
&& chmod +x /usr/bin/license-check
RUN license-check -path ./ --verbose=false "Alex Ellis" "OpenFaaS Project"
RUN gofmt -l -d $(find . -type f -name '*.go' -not -path "./vendor/*") \
&& CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o faas-swarm .
FROM alpine:3.6
RUN apk --no-cache add ca-certificates
WORKDIR /root/
EXPOSE 8080
ENV http_proxy ""
ENV https_proxy ""
COPY --from=0 /go/src/github.com/openfaas/faas-swarm/faas-swarm .
CMD ["./faas-swarm"]