diff --git a/.gitignore b/.gitignore index 3d7624ab..d6070427 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ -fwatchdog **/node_modules/ +fwatchdog +fwatchdog-armhf diff --git a/sample-functions/AlpineFunction/Dockerfile.armhf b/sample-functions/AlpineFunction/Dockerfile.armhf index 0d01a429..76d45027 100644 --- a/sample-functions/AlpineFunction/Dockerfile.armhf +++ b/sample-functions/AlpineFunction/Dockerfile.armhf @@ -1,6 +1,6 @@ -FROM armhf/alpine:latest +FROM armhf/alpine:3.5 -COPY fwatchdog /usr/bin +ADD https://github.com/alexellis/faas/releases/download/v0.3-alpha/fwatchdog-armhf /usr/bin/fwatchdog RUN chmod +x /usr/bin/fwatchdog # Populate example here diff --git a/sample-functions/MarkdownRender/Dockerfile.armhf b/sample-functions/MarkdownRender/Dockerfile.armhf new file mode 100644 index 00000000..44eadd05 --- /dev/null +++ b/sample-functions/MarkdownRender/Dockerfile.armhf @@ -0,0 +1,15 @@ +FROM armhf/alpine:3.5 + +ADD https://github.com/alexellis/faas/releases/download/v0.3-alpha/fwatchdog-armhf /usr/bin/fwatchdog +RUN chmod +x /usr/bin/fwatchdog + +WORKDIR /root/ + +EXPOSE 8080 +ENV http_proxy "" +ENV https_proxy "" + +COPY app . + +ENV fprocess="/root/app" +CMD ["fwatchdog"] diff --git a/sample-functions/MarkdownRender/Dockerfile.build.armhf b/sample-functions/MarkdownRender/Dockerfile.build.armhf new file mode 100644 index 00000000..1e0ed376 --- /dev/null +++ b/sample-functions/MarkdownRender/Dockerfile.build.armhf @@ -0,0 +1,11 @@ +FROM alexellis2/alexellis2/go-armhf:1.7.4 + +RUN mkdir -p /go/src/app +COPY handler.go /go/src/app +WORKDIR /go/src/app +RUN go get github.com/microcosm-cc/bluemonday && \ + go get github.com/russross/blackfriday + +RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app . + +CMD ["echo"] diff --git a/sample-functions/MarkdownRender/build.armhf.sh b/sample-functions/MarkdownRender/build.armhf.sh new file mode 100755 index 00000000..09709a93 --- /dev/null +++ b/sample-functions/MarkdownRender/build.armhf.sh @@ -0,0 +1,14 @@ +#!/bin/sh +echo Building alexellis2/faas-markdownrender:build-armhf + +docker build --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy \ + -t alexellis2/faas-markdownrender:build-armhf \ + . -f Dockerfile.build.armhf + +docker create --name render_extract alexellis2/faas-markdownrender:build-armhf +docker cp render_extract:/go/src/app/app ./app +docker rm -f render_extract + +echo Building alexellis2/faas-markdownrender:latest-armhf +docker build --no-cache -t alexellis2/faas-markdownrender:latest-armhf .\ + -f Dockerfile.armhf diff --git a/watchdog/build.armhf.sh b/watchdog/build.armhf.sh new file mode 100755 index 00000000..6fffdfec --- /dev/null +++ b/watchdog/build.armhf.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +# Below makes use of "builder pattern" so that binary is extracted separate +# from the golang runtime/SDK + +echo Building alexellis2/faas-watchdog:build-armhf + +docker build --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy \ + -t alexellis2/faas-watchdog:build-armhf . -f Dockerfile.armhf +docker create --name buildoutput alexellis2/faas-watchdog:build-armhf echo +docker cp buildoutput:/go/src/app/app ./fwatchdog-armhf +docker rm buildoutput +