diff --git a/sample-functions/AlpineFunction/Dockerfile b/sample-functions/AlpineFunction/Dockerfile index c9ba3ce6..3fe5c814 100644 --- a/sample-functions/AlpineFunction/Dockerfile +++ b/sample-functions/AlpineFunction/Dockerfile @@ -1,8 +1,9 @@ -FROM alpine:3.8 +FROM openfaas/classic-watchdog:0.14.4 as watchdog -RUN apk --no-cache add curl \ - && curl -sL https://github.com/openfaas/faas/releases/download/0.13.0/fwatchdog > /usr/bin/fwatchdog \ - && chmod +x /usr/bin/fwatchdog +FROM alpine:3.9 + +COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog +RUN chmod +x /usr/bin/fwatchdog # Populate example here # ENV fprocess="wc -l" diff --git a/sample-functions/AlpineFunction/Dockerfile.arm64 b/sample-functions/AlpineFunction/Dockerfile.arm64 index 00aa8419..3fe5c814 100644 --- a/sample-functions/AlpineFunction/Dockerfile.arm64 +++ b/sample-functions/AlpineFunction/Dockerfile.arm64 @@ -1,8 +1,9 @@ -FROM alpine:3.8 +FROM openfaas/classic-watchdog:0.14.4 as watchdog -RUN apk --no-cache add curl \ - && curl -sL https://github.com/openfaas/faas/releases/download/0.13.0/fwatchdog-arm64 > /usr/bin/fwatchdog \ - && chmod +x /usr/bin/fwatchdog +FROM alpine:3.9 + +COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog +RUN chmod +x /usr/bin/fwatchdog # Populate example here # ENV fprocess="wc -l" diff --git a/sample-functions/AlpineFunction/Dockerfile.armhf b/sample-functions/AlpineFunction/Dockerfile.armhf index b8e7dbdf..3fe5c814 100644 --- a/sample-functions/AlpineFunction/Dockerfile.armhf +++ b/sample-functions/AlpineFunction/Dockerfile.armhf @@ -1,10 +1,12 @@ -FROM alpine:3.8 +FROM openfaas/classic-watchdog:0.14.4 as watchdog -RUN apk --no-cache add curl \ - && curl -sL https://github.com/openfaas/faas/releases/download/0.13.0/fwatchdog-armhf > /usr/bin/fwatchdog \ - && chmod +x /usr/bin/fwatchdog +FROM alpine:3.9 + +COPY --from=watchdog /fwatchdog /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/NodeInfo/Dockerfile b/sample-functions/NodeInfo/Dockerfile index f3f4c19d..59181014 100644 --- a/sample-functions/NodeInfo/Dockerfile +++ b/sample-functions/NodeInfo/Dockerfile @@ -1,11 +1,12 @@ -FROM alpine:3.8 +FROM openfaas/classic-watchdog:0.14.4 as watchdog + +FROM alpine:3.9 + +COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog +RUN chmod +x /usr/bin/fwatchdog RUN apk --update add nodejs nodejs-npm -RUN apk --no-cache add curl \ - && curl -sL https://github.com/openfaas/faas/releases/download/0.13.0/fwatchdog > /usr/bin/fwatchdog \ - && chmod +x /usr/bin/fwatchdog - COPY package.json . COPY main.js . diff --git a/sample-functions/NodeInfo/Dockerfile.arm64 b/sample-functions/NodeInfo/Dockerfile.arm64 index 8941ef0c..59181014 100644 --- a/sample-functions/NodeInfo/Dockerfile.arm64 +++ b/sample-functions/NodeInfo/Dockerfile.arm64 @@ -1,13 +1,16 @@ -FROM alpine:3.8 +FROM openfaas/classic-watchdog:0.14.4 as watchdog + +FROM alpine:3.9 + +COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog +RUN chmod +x /usr/bin/fwatchdog RUN apk --update add nodejs nodejs-npm -RUN apk --no-cache add curl \ - && curl -sL https://github.com/openfaas/faas/releases/download/0.13.0/fwatchdog-arm64 > /usr/bin/fwatchdog \ - && chmod +x /usr/bin/fwatchdog - COPY package.json . COPY main.js . + RUN npm i + ENV fprocess="node main.js" CMD ["fwatchdog"] diff --git a/sample-functions/NodeInfo/Dockerfile.armhf b/sample-functions/NodeInfo/Dockerfile.armhf index aa6d9bd7..59181014 100644 --- a/sample-functions/NodeInfo/Dockerfile.armhf +++ b/sample-functions/NodeInfo/Dockerfile.armhf @@ -1,13 +1,16 @@ -FROM alpine:3.8 -RUN apk --no-cache add nodejs nodejs-npm +FROM openfaas/classic-watchdog:0.14.4 as watchdog -RUN apk --no-cache add curl \ - && curl -sL https://github.com/openfaas/faas/releases/download/0.13.0/fwatchdog-armhf > /usr/bin/fwatchdog \ - && chmod +x /usr/bin/fwatchdog +FROM alpine:3.9 + +COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog +RUN chmod +x /usr/bin/fwatchdog + +RUN apk --update add nodejs nodejs-npm 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"]