mirror of
https://github.com/openfaas/faas.git
synced 2025-06-08 16:26:47 +00:00
Note, not all `alexellis/github` references should be changed, there are a number of repos which are not part of the openfaas org, this commit excludes those. Signed-off-by: John McCabe <john@johnmccabe.net>
23 lines
894 B
Docker
23 lines
894 B
Docker
FROM golang:1.8.3
|
|
RUN mkdir -p /go/src/github.com/openfaas/faas/watchdog
|
|
WORKDIR /go/src/github.com/openfaas/faas/watchdog
|
|
|
|
COPY main.go .
|
|
COPY readconfig.go .
|
|
COPY config_test.go .
|
|
COPY requesthandler_test.go .
|
|
#COPY fastForkRequestHandler.go .
|
|
#COPY requestHandler.go .
|
|
COPY types types
|
|
|
|
# Run a gofmt and exclude all vendored code.
|
|
RUN gofmt -l -d $(find . -type f -name '*.go' -not -path "./vendor/*")
|
|
|
|
RUN go test
|
|
|
|
# Stripping via -ldflags "-s -w"
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -a -ldflags "-s -w" -installsuffix cgo -o watchdog . \
|
|
&& GOARM=6 GOARCH=arm CGO_ENABLED=0 GOOS=linux go build -a -ldflags "-s -w" -installsuffix cgo -o watchdog-armhf . \
|
|
&& GOARCH=arm64 CGO_ENABLED=0 GOOS=linux go build -a -ldflags "-s -w" -installsuffix cgo -o watchdog-arm64 . \
|
|
&& GOOS=windows CGO_ENABLED=0 go build -a -ldflags "-s -w" -installsuffix cgo -o watchdog.exe .
|