diff --git a/sample-functions/AlpineFunction/Dockerfile.armhf b/sample-functions/AlpineFunction/Dockerfile.armhf index 76d45027c10d67524e07f74d41aef8674f6664fc..e349dd7f998905c7f07f1968687963b7d7ec9480 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 134a7ba4b825a7b0c903975c28db21f4a741ef17..738913bb5060ae52cf57a58cc6f2767438fb41a8 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 b70b8ebff2879910fb0bce22553ba5b451d7b6ae..425d58307f01ecb7f93a0cfad712a72e0d0d87ad 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 bd526a3acedf1ce6aa225265235a52e21f177a75..e13639488fa5b93604c66210355c728a5477d378 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 e9e65753818e2ecae63cbd499856c94475401570..57e8d320adb1f3400150a6eea49e6c842af4b754 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 c0dcd2dc55f4fc491a09ea2c6b6f776487807762..0000000000000000000000000000000000000000 --- 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 7eb1e34a301ebb8f935aaaf4072bc470d05ea57b..0000000000000000000000000000000000000000 --- 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 de57c707011c4fd3eb9d6ec0bb1fa75d6e097fdc..0000000000000000000000000000000000000000 --- 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 d35e9625d793d0953085209658ebb733d7f83f9e..0000000000000000000000000000000000000000 --- 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 5a2d657891beec0f8fa8412d50a333bee2163672..be352794dca228f603cb671301685f69709d6bf5 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 1314984548b78fde4408ab886aa8ddc963a749a1..b20428cca84edf90b20f2310202b8b82bd2c6559 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 0000000000000000000000000000000000000000..f7ded0be3ae66ce8a10cd2e9f6fd615db31e8d94 --- /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 0000000000000000000000000000000000000000..038f9a4ae49e5f8d2165621e571479a711f08e86 --- /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 d46f4d25473a5ebc3c2e58978065b98662215642..49224e202ae37f0e8e1286ecbad347e83c39b73e 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 0000000000000000000000000000000000000000..375ca98ec4f18d4cbec694b5f6e1e12f8201630e --- /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 0000000000000000000000000000000000000000..ee6ae9563555a13704be3f826baf42f3c6bbc974 --- /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 +