diff --git a/sample-functions/AlpineFunction/Dockerfile.armhf b/sample-functions/AlpineFunction/Dockerfile.armhf index 76d45027..e349dd7f 100644 --- a/sample-functions/AlpineFunction/Dockerfile.armhf +++ b/sample-functions/AlpineFunction/Dockerfile.armhf @@ -1,8 +1,9 @@ -FROM armhf/alpine:3.5 +FROM arm32v6/alpine:3.6 -ADD https://github.com/alexellis/faas/releases/download/v0.3-alpha/fwatchdog-armhf /usr/bin/fwatchdog +ADD https://github.com/alexellis/faas/releases/download/0.6.0/fwatchdog-armhf /usr/bin/fwatchdog RUN chmod +x /usr/bin/fwatchdog # Populate example here # ENV fprocess="wc -l" +HEALTHCHECK --interval=5s CMD [ -e /tmp/.lock ] || exit 1 CMD ["fwatchdog"] diff --git a/sample-functions/CaptainsIntent/Dockerfile b/sample-functions/CaptainsIntent/Dockerfile index 134a7ba4..738913bb 100644 --- a/sample-functions/CaptainsIntent/Dockerfile +++ b/sample-functions/CaptainsIntent/Dockerfile @@ -1,5 +1,5 @@ FROM alpine:latest -RUN apk --update add nodejs +RUN apk --update add nodejs nodejs-npm ADD https://github.com/alexellis/faas/releases/download/v0.5-alpha/fwatchdog /usr/bin RUN chmod +x /usr/bin/fwatchdog diff --git a/sample-functions/ChangeColorIntent/Dockerfile b/sample-functions/ChangeColorIntent/Dockerfile index b70b8ebf..425d5830 100644 --- a/sample-functions/ChangeColorIntent/Dockerfile +++ b/sample-functions/ChangeColorIntent/Dockerfile @@ -1,5 +1,5 @@ FROM alpine:latest -RUN apk --update add nodejs +RUN apk --update add nodejs nodejs-npm ADD https://github.com/alexellis/faas/releases/download/v0.5-alpha/fwatchdog /usr/bin #COPY ./fwatchdog /usr/bin/ diff --git a/sample-functions/HostnameIntent/Dockerfile b/sample-functions/HostnameIntent/Dockerfile index bd526a3a..e1363948 100644 --- a/sample-functions/HostnameIntent/Dockerfile +++ b/sample-functions/HostnameIntent/Dockerfile @@ -1,5 +1,5 @@ FROM alpine:latest -RUN apk --update add nodejs +RUN apk --update add nodejs nodejs-npm ADD https://github.com/alexellis/faas/releases/download/v0.5-alpha/fwatchdog /usr/bin RUN chmod +x /usr/bin/fwatchdog diff --git a/sample-functions/MarkdownRender/Dockerfile.armhf b/sample-functions/MarkdownRender/Dockerfile.armhf index e9e65753..57e8d320 100644 --- a/sample-functions/MarkdownRender/Dockerfile.armhf +++ b/sample-functions/MarkdownRender/Dockerfile.armhf @@ -1,6 +1,6 @@ -FROM armhf/alpine:3.5 +FROM arm32v6/alpine:3.6 -ADD https://github.com/alexellis/faas/releases/download/0.5.4-alpha/fwatchdog-armhf /usr/bin/fwatchdog +ADD https://github.com/alexellis/faas/releases/download/0.6.0/fwatchdog-armhf /usr/bin/fwatchdog RUN chmod +x /usr/bin/fwatchdog WORKDIR /root/ diff --git a/sample-functions/NodeBaseFunction/Dockerfile b/sample-functions/NodeBaseFunction/Dockerfile deleted file mode 100644 index c0dcd2dc..00000000 --- a/sample-functions/NodeBaseFunction/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM node:6.9.1-alpine - -ADD https://github.com/alexellis/faas/releases/download/0.5.1-alpha/fwatchdog /usr/bin -RUN chmod +x /usr/bin/fwatchdog - -WORKDIR /root/ - -COPY package.json . - -# Provides a boot-strap into your function, just add handler.js to derived image -RUN npm i -COPY faas_index.js . - -ENV fprocess="node faas_index.js" - -HEALTHCHECK --interval=5s CMD [ -e /tmp/.lock ] || exit 1 - -CMD ["fwatchdog"] diff --git a/sample-functions/NodeBaseFunction/build.sh b/sample-functions/NodeBaseFunction/build.sh deleted file mode 100755 index 7eb1e34a..00000000 --- a/sample-functions/NodeBaseFunction/build.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -echo "Building functions/nodebase:alpine-6.9.1" -docker build -t functions/nodebase:alpine-6.9.1 . - diff --git a/sample-functions/NodeBaseFunction/faas_index.js b/sample-functions/NodeBaseFunction/faas_index.js deleted file mode 100644 index de57c707..00000000 --- a/sample-functions/NodeBaseFunction/faas_index.js +++ /dev/null @@ -1,29 +0,0 @@ -"use strict" - -let getStdin = require('get-stdin'); - -let handler = require('./handler'); - -getStdin().then(val => { - - let req; - if(process.env.json) { - req = JSON.parse(val); - } else { - req = val - } - - handler(req, (err, res) => { - if(err) { - return console.error(err); - } - - if(process.env.json) { - console.log(JSON.stringify(res)); - } else { - console.log(res); - } - }); -}).catch(e => { - console.error(e.stack); -}); diff --git a/sample-functions/NodeBaseFunction/package.json b/sample-functions/NodeBaseFunction/package.json deleted file mode 100644 index d35e9625..00000000 --- a/sample-functions/NodeBaseFunction/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "NodejsBase", - "version": "1.0.0", - "description": "", - "main": "faas_index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "keywords": [], - "author": "", - "license": "ISC", - "dependencies": { - "get-stdin": "^5.0.1" - } -} diff --git a/sample-functions/NodeInfo/Dockerfile b/sample-functions/NodeInfo/Dockerfile index 5a2d6578..be352794 100644 --- a/sample-functions/NodeInfo/Dockerfile +++ b/sample-functions/NodeInfo/Dockerfile @@ -1,5 +1,5 @@ FROM alpine:latest -RUN apk --update add nodejs +RUN apk --update add nodejs nodejs-npm ADD https://github.com/alexellis/faas/releases/download/0.6.0/fwatchdog /usr/bin RUN chmod +x /usr/bin/fwatchdog diff --git a/sample-functions/NodeInfo/Dockerfile.armhf b/sample-functions/NodeInfo/Dockerfile.armhf index 13149845..b20428cc 100644 --- a/sample-functions/NodeInfo/Dockerfile.armhf +++ b/sample-functions/NodeInfo/Dockerfile.armhf @@ -1,11 +1,12 @@ -FROM armhf/alpine:latest -RUN apk --no-cache add nodejs +FROM arm32v6/alpine:latest +RUN apk --no-cache add nodejs nodejs-npm -COPY fwatchdog-armhf /usr/bin/fwatchdog +ADD https://github.com/alexellis/faas/releases/download/0.6.0/fwatchdog-armhf /usr/bin/fwatchdog RUN chmod +x /usr/bin/fwatchdog COPY package.json . COPY main.js . RUN npm i ENV fprocess="node main.js" +HEALTHCHECK --interval=5s CMD [ -e /tmp/.lock ] || exit 1 CMD ["fwatchdog"] diff --git a/sample-functions/ResizeImageMagick/Dockerfile.armhf b/sample-functions/ResizeImageMagick/Dockerfile.armhf new file mode 100644 index 00000000..f7ded0be --- /dev/null +++ b/sample-functions/ResizeImageMagick/Dockerfile.armhf @@ -0,0 +1,13 @@ +FROM arm32v6/alpine:3.6 + +RUN apk --no-cache add imagemagick + +ADD https://github.com/alexellis/faas/releases/download/0.6.0/fwatchdog-armhf /usr/bin/fwatchdog +RUN chmod +x /usr/bin/fwatchdog + +ENV fprocess "convert - -resize 50% fd:1" + +EXPOSE 8080 + +HEALTHCHECK --interval=1s CMD [ -e /tmp/.lock ] || exit 1 +CMD [ "/usr/bin/fwatchdog"] diff --git a/sample-functions/ResizeImageMagick/build.armhf.sh b/sample-functions/ResizeImageMagick/build.armhf.sh new file mode 100644 index 00000000..038f9a4a --- /dev/null +++ b/sample-functions/ResizeImageMagick/build.armhf.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +echo "Building functions/resizer:armhf..." +docker build -t functions/resizer:armhf -f Dockerfile.armhf . diff --git a/sample-functions/SentimentAnalysis/Dockerfile b/sample-functions/SentimentAnalysis/Dockerfile index d46f4d25..49224e20 100644 --- a/sample-functions/SentimentAnalysis/Dockerfile +++ b/sample-functions/SentimentAnalysis/Dockerfile @@ -1,6 +1,7 @@ FROM python:2.7-alpine -RUN pip install textblob -RUN python -m textblob.download_corpora + +RUN pip install textblob && \ + python -m textblob.download_corpora ADD https://github.com/alexellis/faas/releases/download/0.5.1-alpha/fwatchdog /usr/bin RUN chmod +x /usr/bin/fwatchdog diff --git a/sample-functions/SentimentAnalysis/Dockerfile.armhf b/sample-functions/SentimentAnalysis/Dockerfile.armhf new file mode 100644 index 00000000..375ca98e --- /dev/null +++ b/sample-functions/SentimentAnalysis/Dockerfile.armhf @@ -0,0 +1,17 @@ +FROM arm32v7/python:2.7-slim + +RUN pip install textblob && \ + python -m textblob.download_corpora + +ADD https://github.com/alexellis/faas/releases/download/0.6.0/fwatchdog-armhf /usr/bin/fwatchdog +RUN chmod +x /usr/bin/fwatchdog + +WORKDIR /root/ + +COPY handler.py . + +ENV fprocess="python handler.py" + +HEALTHCHECK --interval=1s CMD [ -e /tmp/.lock ] || exit 1 + +CMD ["fwatchdog"] diff --git a/sample-functions/SentimentAnalysis/build.armhf.sh b/sample-functions/SentimentAnalysis/build.armhf.sh new file mode 100644 index 00000000..ee6ae956 --- /dev/null +++ b/sample-functions/SentimentAnalysis/build.armhf.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +echo "Building functions/sentimentanalysis:armhf..." +docker build -t functions/sentimentanalysis:armhf . -f Dockerfile.armhf +