Add Golang hello-world sample, rename build.sh to match auto-build on Hub.

This commit is contained in:
Alex
2017-04-09 20:20:09 +01:00
parent 8ec31d9b89
commit 03e702862b
7 changed files with 49 additions and 11 deletions

View File

@ -0,0 +1,17 @@
FROM golang:1.7.5-alpine
MAINTAINER alexellis2@gmail.com
ENTRYPOINT []
WORKDIR /go/src/github.com/alexellis/faas/sample-functions/golang
COPY . /go/src/github.com/alexellis/faas/sample-functions/golang
RUN go install
ADD https://github.com/alexellis/faas/releases/download/v0.5-alpha/fwatchdog /usr/bin
RUN chmod +x /usr/bin/fwatchdog
ENV fprocess "/go/bin/golang"
HEALTHCHECK --interval=1s CMD [ -e /tmp/.lock ] || exit 1
CMD [ "/usr/bin/fwatchdog"]

View File

@ -0,0 +1,4 @@
#!/bin/sh
echo "Building functions/base:golang-1.7.5-alpine"
docker build -t functions/base:golang-1.7.5-alpine .

View File

@ -0,0 +1,16 @@
package main
import (
"fmt"
"io/ioutil"
"log"
"os"
)
func main() {
input, err := ioutil.ReadAll(os.Stdin)
if err != nil {
log.Fatalf("Unable to read standard input: %s", err.Error())
}
fmt.Println(string(input))
}