Merge pull request #124 from rgee0/updateSamples3

New armhf and updated sample function Dockerfiles
This commit is contained in:
Alex Ellis 2017-08-14 20:57:30 +01:00 committed by GitHub
commit ea49d5e5f9
16 changed files with 55 additions and 80 deletions

View File

@ -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"]

View File

@ -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

View File

@ -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/

View File

@ -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

View File

@ -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/

View File

@ -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"]

View File

@ -1,5 +0,0 @@
#!/bin/sh
echo "Building functions/nodebase:alpine-6.9.1"
docker build -t functions/nodebase:alpine-6.9.1 .

View File

@ -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);
});

View File

@ -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"
}
}

View File

@ -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

View File

@ -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"]

View File

@ -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"]

View File

@ -0,0 +1,4 @@
#!/bin/sh
echo "Building functions/resizer:armhf..."
docker build -t functions/resizer:armhf -f Dockerfile.armhf .

View File

@ -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

View File

@ -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"]

View File

@ -0,0 +1,5 @@
#!/bin/sh
echo "Building functions/sentimentanalysis:armhf..."
docker build -t functions/sentimentanalysis:armhf . -f Dockerfile.armhf