diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a6408e18..c36f4f54 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -18,6 +18,10 @@ $ faas template pull https://github.com/owner/repo Multiple templates can be stored within a single Git repository. View [the CLI reference guide](https://github.com/openfaas/faas-cli) for how to build a template. +## Modifying templates + + ```./verify.sh``` can be utilized to verify your changes to templates in this repo. + ## Guidelines apply from main OpenFaaS repo See guide for [FaaS](https://github.com/openfaas/faas/blob/master/CONTRIBUTING.md) here. diff --git a/template/java8/Dockerfile b/template/java8/Dockerfile index bba20b8c..bf2228ec 100644 --- a/template/java8/Dockerfile +++ b/template/java8/Dockerfile @@ -26,8 +26,6 @@ FROM openfaas/of-watchdog:0.5.4 as watchdog FROM openjdk:8u212-jdk-alpine as ship -ARG WATCHDOG_VERSION=0.5.1 - COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog RUN chmod +x /usr/bin/fwatchdog diff --git a/template/node-arm64/Dockerfile b/template/node-arm64/Dockerfile index 923a2be8..b59d2d3d 100644 --- a/template/node-arm64/Dockerfile +++ b/template/node-arm64/Dockerfile @@ -1,13 +1,9 @@ +FROM openfaas/classic-watchdog:0.15.4 as watchdog + FROM arm64v8/node:8.9.1 -RUN apt-get update -qy \ - && apt-get install -qy curl ca-certificates --no-install-recommends \ - && echo "Pulling watchdog binary from Github." \ - && curl -sSL https://github.com/openfaas/faas/releases/download/0.13.0/fwatchdog-arm64 > /usr/bin/fwatchdog \ - && chmod +x /usr/bin/fwatchdog \ - && apt-get -qy remove curl \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* +COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog +RUN chmod +x /usr/bin/fwatchdog WORKDIR /root/ diff --git a/template/node-armhf/Dockerfile b/template/node-armhf/Dockerfile index 06f38b26..084fb1ca 100644 --- a/template/node-armhf/Dockerfile +++ b/template/node-armhf/Dockerfile @@ -1,11 +1,11 @@ +FROM openfaas/classic-watchdog:0.15.4 as watchdog + FROM arm32v6/alpine:3.6 +COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog +RUN chmod +x /usr/bin/fwatchdog + RUN apk add --no-cache nodejs nodejs-npm ca-certificates -RUN apk --no-cache add curl \ - && echo "Pulling watchdog binary from Github." \ - && curl -sSL https://github.com/openfaas/faas/releases/download/0.13.0/fwatchdog-armhf > /usr/bin/fwatchdog \ - && chmod +x /usr/bin/fwatchdog \ - && apk del curl --no-cache WORKDIR /root/ diff --git a/template/node/Dockerfile b/template/node/Dockerfile index f397a4da..6284d599 100644 --- a/template/node/Dockerfile +++ b/template/node/Dockerfile @@ -1,11 +1,11 @@ +FROM openfaas/classic-watchdog:0.15.4 as watchdog + FROM node:8.9.1-alpine +COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog +RUN chmod +x /usr/bin/fwatchdog + RUN addgroup -S app && adduser app -S -G app -RUN apk --no-cache add curl \ - && echo "Pulling watchdog binary from Github." \ - && curl -sSL https://github.com/openfaas/faas/releases/download/0.13.0/fwatchdog > /usr/bin/fwatchdog \ - && chmod +x /usr/bin/fwatchdog \ - && apk del curl --no-cache WORKDIR /root/ diff --git a/template/python-armhf/Dockerfile b/template/python-armhf/Dockerfile index 227e9128..e7dca215 100644 --- a/template/python-armhf/Dockerfile +++ b/template/python-armhf/Dockerfile @@ -1,14 +1,15 @@ +FROM openfaas/classic-watchdog:0.15.4 as watchdog + FROM python:2.7-alpine +COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog +RUN chmod +x /usr/bin/fwatchdog + # Allows you to add additional packages via build-arg ARG ADDITIONAL_PACKAGE # Alternatively use ADD https:// (which will not be cached by Docker builder) -RUN apk --no-cache add curl ${ADDITIONAL_PACKAGE} \ - && echo "Pulling watchdog binary from Github." \ - && curl -sSL https://github.com/openfaas/faas/releases/download/0.13.0/fwatchdog-armhf > /usr/bin/fwatchdog \ - && chmod +x /usr/bin/fwatchdog \ - && apk del curl --no-cache +RUN apk --no-cache add ${ADDITIONAL_PACKAGE} # Add non root user RUN addgroup -S app && adduser app -S -G app diff --git a/template/python3-armhf/Dockerfile b/template/python3-armhf/Dockerfile index a2e3d350..1a0b757c 100644 --- a/template/python3-armhf/Dockerfile +++ b/template/python3-armhf/Dockerfile @@ -1,14 +1,13 @@ +FROM openfaas/classic-watchdog:0.15.4 as watchdog + FROM python:3-alpine # Allows you to add additional packages via build-arg ARG ADDITIONAL_PACKAGE -# Alternatively use ADD https:// (which will not be cached by Docker builder) -RUN apk --no-cache add curl ${ADDITIONAL_PACKAGE} \ - && echo "Pulling watchdog binary from Github." \ - && curl -sSL https://github.com/openfaas/faas/releases/download/0.13.0/fwatchdog-armhf > /usr/bin/fwatchdog \ - && chmod +x /usr/bin/fwatchdog \ - && apk del curl --no-cache +COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog +RUN chmod +x /usr/bin/fwatchdog +RUN apk --no-cache add ${ADDITIONAL_PACKAGE} # Add non root user RUN addgroup -S app && adduser app -S -G app diff --git a/template/ruby/Dockerfile b/template/ruby/Dockerfile index 364f1bea..5622f7fd 100644 --- a/template/ruby/Dockerfile +++ b/template/ruby/Dockerfile @@ -1,13 +1,14 @@ +FROM openfaas/classic-watchdog:0.15.4 as watchdog + FROM ruby:2.5.1-alpine3.7 +COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog +RUN chmod +x /usr/bin/fwatchdog + ARG ADDITIONAL_PACKAGE # Alternatively use ADD https:// (which will not be cached by Docker builder) -RUN apk --no-cache add curl ${ADDITIONAL_PACKAGE} \ - && echo "Pulling watchdog binary from Github." \ - && curl -sSL https://github.com/openfaas/faas/releases/download/0.13.0/fwatchdog > /usr/bin/fwatchdog \ - && chmod +x /usr/bin/fwatchdog \ - && apk del curl --no-cache +RUN apk --no-cache add ${ADDITIONAL_PACKAGE} WORKDIR /home/app