Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions template/golang-http-armhf/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
FROM openfaas/of-watchdog:0.7.2 as watchdog

FROM golang:1.11-alpine3.10 as build

ENV CGO_ENABLED=0
FROM golang:1.13.1-alpine3.10 as build

RUN apk --no-cache add git

COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog
RUN chmod +x /usr/bin/fwatchdog

ENV CGO_ENABLED=0

RUN mkdir -p /go/src/handler
WORKDIR /go/src/handler
COPY . .

# Run a gofmt and exclude all vendored code.
RUN test -z "$(gofmt -l $(find . -type f -name '*.go' -not -path "./vendor/*" -not -path "./function/vendor/*"))" || { echo "Run \"gofmt -s -w\" on your Golang code"; exit 1; }

RUN CGO_ENABLED=0 GOOS=linux \
go build --ldflags "-s -w" -a -installsuffix cgo -o handler . && \
go test $(go list ./... | grep -v /vendor/) -cover
ARG GO111MODULE="off"
ARG GOPROXY=""

RUN go build --ldflags "-s -w" -a -installsuffix cgo -o handler .
RUN go test handler/function/... -cover

FROM alpine:3.10
# Add non root user and certs
Expand Down
15 changes: 0 additions & 15 deletions template/golang-http-armhf/Gopkg.lock

This file was deleted.

7 changes: 7 additions & 0 deletions template/golang-http-armhf/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module handler

go 1.12

replace handler/function => ./function

require github.com/openfaas-incubator/go-function-sdk v0.0.0-20181217173454-cac4b8744921
2 changes: 2 additions & 0 deletions template/golang-http-armhf/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github.com/openfaas-incubator/go-function-sdk v0.0.0-20181217173454-cac4b8744921 h1:IGP0tlTdv6r/zy3Kw61EhiXao61krCUs5KRHWSzCdxM=
github.com/openfaas-incubator/go-function-sdk v0.0.0-20181217173454-cac4b8744921/go.mod h1:F37Kp+hwdHP+o3UKjkGzikQg4weKiMvcegT9vCQjvjE=

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions template/golang-http-armhf/vendor/modules.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# github.com/openfaas-incubator/go-function-sdk v0.0.0-20181217173454-cac4b8744921
github.com/openfaas-incubator/go-function-sdk
14 changes: 10 additions & 4 deletions template/golang-http/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
FROM openfaas/of-watchdog:0.7.2 as watchdog

FROM golang:1.10.4-alpine3.8 as build
FROM golang:1.13.1-alpine3.10 as build

RUN apk --no-cache add git

ENV CGO_ENABLED=0

COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog
RUN chmod +x /usr/bin/fwatchdog

ENV CGO_ENABLED=0

RUN mkdir -p /go/src/handler
WORKDIR /go/src/handler
COPY . .

# Run a gofmt and exclude all vendored code.
RUN test -z "$(gofmt -l $(find . -type f -name '*.go' -not -path "./vendor/*" -not -path "./function/vendor/*"))" || { echo "Run \"gofmt -s -w\" on your Golang code"; exit 1; }

RUN CGO_ENABLED=0 GOOS=linux \
go build --ldflags "-s -w" -a -installsuffix cgo -o handler . && \
go test $(go list ./... | grep -v /vendor/) -cover
ARG GO111MODULE="off"
ARG GOPROXY=""

RUN go build --ldflags "-s -w" -a -installsuffix cgo -o handler .
RUN go test handler/function/... -cover

FROM alpine:3.10
# Add non root user and certs
Expand Down
15 changes: 0 additions & 15 deletions template/golang-http/Gopkg.lock

This file was deleted.

26 changes: 0 additions & 26 deletions template/golang-http/Gopkg.toml

This file was deleted.

7 changes: 7 additions & 0 deletions template/golang-http/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module handler

go 1.12

replace handler/function => ./function

require github.com/openfaas-incubator/go-function-sdk v0.0.0-20181217173454-cac4b8744921
2 changes: 2 additions & 0 deletions template/golang-http/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github.com/openfaas-incubator/go-function-sdk v0.0.0-20181217173454-cac4b8744921 h1:IGP0tlTdv6r/zy3Kw61EhiXao61krCUs5KRHWSzCdxM=
github.com/openfaas-incubator/go-function-sdk v0.0.0-20181217173454-cac4b8744921/go.mod h1:F37Kp+hwdHP+o3UKjkGzikQg4weKiMvcegT9vCQjvjE=

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions template/golang-http/vendor/modules.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# github.com/openfaas-incubator/go-function-sdk v0.0.0-20181217173454-cac4b8744921
github.com/openfaas-incubator/go-function-sdk
16 changes: 9 additions & 7 deletions template/golang-middleware-armhf/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
FROM openfaas/of-watchdog:0.7.2 as watchdog
FROM golang:1.13.1-alpine3.10 as build


FROM golang:1.11-alpine3.10 as build

ENV CGO_ENABLED=0
RUN apk --no-cache add git

COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog
RUN chmod +x /usr/bin/fwatchdog

ENV CGO_ENABLED=0

RUN mkdir -p /go/src/handler
WORKDIR /go/src/handler
COPY . .

# Run a gofmt and exclude all vendored code.
RUN test -z "$(gofmt -l $(find . -type f -name '*.go' -not -path "./vendor/*" -not -path "./function/vendor/*"))" || { echo "Run \"gofmt -s -w\" on your Golang code"; exit 1; }

RUN CGO_ENABLED=0 GOOS=linux \
go build --ldflags "-s -w" -a -installsuffix cgo -o handler . && \
go test $(go list ./... | grep -v /vendor/) -cover
ARG GO111MODULE="off"
ARG GOPROXY=""

RUN go build --ldflags "-s -w" -a -installsuffix cgo -o handler .
RUN go test handler/function/... -cover

FROM alpine:3.10
# Add non root user and certs
Expand Down
5 changes: 5 additions & 0 deletions template/golang-middleware-armhf/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module handler

go 1.12

replace handler/function => ./function
14 changes: 9 additions & 5 deletions template/golang-middleware/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
FROM openfaas/of-watchdog:0.7.2 as watchdog

FROM golang:1.11-alpine3.10 as build
FROM golang:1.13.1-alpine3.10 as build

ENV CGO_ENABLED=0
RUN apk --no-cache add git

COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog
RUN chmod +x /usr/bin/fwatchdog

ENV CGO_ENABLED=0

RUN mkdir -p /go/src/handler
WORKDIR /go/src/handler
COPY . .

# Run a gofmt and exclude all vendored code.
RUN test -z "$(gofmt -l $(find . -type f -name '*.go' -not -path "./vendor/*" -not -path "./function/vendor/*"))" || { echo "Run \"gofmt -s -w\" on your Golang code"; exit 1; }

RUN CGO_ENABLED=0 GOOS=linux \
go build --ldflags "-s -w" -a -installsuffix cgo -o handler . && \
go test $(go list ./... | grep -v /vendor/) -cover
ARG GO111MODULE="off"
ARG GOPROXY=""

RUN go build --ldflags "-s -w" -a -installsuffix cgo -o handler .
RUN go test handler/function/... -cover

FROM alpine:3.10
# Add non root user and certs
Expand Down
5 changes: 5 additions & 0 deletions template/golang-middleware/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module handler

go 1.12

replace handler/function => ./function