mirror of
https://github.com/openfaas/faas.git
synced 2025-06-14 11:16:47 +00:00
The default should be set to true so we maintain backwards. compatibility. readconfig.go was altered due to bug reading default value. This was tested by adding unit tests to readconfig_test.go for positive and negative scenarios. Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
21 lines
862 B
Docker
21 lines
862 B
Docker
FROM golang:1.8.5
|
|
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 readconfig_test.go .
|
|
COPY requesthandler_test.go .
|
|
COPY types types
|
|
|
|
# Run a gofmt and exclude all vendored code.
|
|
RUN test -z "$(gofmt -l $(find . -type f -name '*.go' -not -path "./vendor/*"))"
|
|
|
|
RUN go test -v ./...
|
|
|
|
# Stripping via -ldflags "-s -w"
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -a -ldflags "-s -w" -installsuffix cgo -o watchdog . \
|
|
&& GOARM=7 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 .
|