diff --git a/auth/basic-auth/Dockerfile b/auth/basic-auth/Dockerfile index a647438a..c848779d 100644 --- a/auth/basic-auth/Dockerfile +++ b/auth/basic-auth/Dockerfile @@ -26,7 +26,7 @@ RUN CGO_ENABLED=${CGO_ENABLED} GOOS=${TARGETOS} GOARCH=${TARGETARCH} go test -v RUN CGO_ENABLED=${CGO_ENABLED} GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build \ --ldflags "-s -w" -a -installsuffix cgo -o handler . -FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine:3.14 as ship +FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine:3.15 as ship # Add non-root user RUN addgroup -S app && adduser -S -g app app \ && mkdir -p /home/app \ diff --git a/gateway/Dockerfile b/gateway/Dockerfile index da061518..9448db39 100644 --- a/gateway/Dockerfile +++ b/gateway/Dockerfile @@ -46,7 +46,7 @@ RUN CGO_ENABLED=${CGO_ENABLED} GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -- -X github.com/openfaas/faas/gateway/types.Arch=${TARGETARCH}" \ -a -installsuffix cgo -o gateway . -FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine:3.14 as ship +FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine:3.15 as ship LABEL org.label-schema.license="MIT" \ org.label-schema.vcs-url="https://github.com/openfaas/faas" \ diff --git a/sample-functions/AlpineFunction/Dockerfile b/sample-functions/AlpineFunction/Dockerfile index c65dbcec..b0ab3b92 100644 --- a/sample-functions/AlpineFunction/Dockerfile +++ b/sample-functions/AlpineFunction/Dockerfile @@ -1,6 +1,6 @@ FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/classic-watchdog:0.1.4 as watchdog -FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine:3.14 +FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine:3.15 COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog RUN chmod +x /usr/bin/fwatchdog diff --git a/sample-functions/BaseFunctions/R/Dockerfile b/sample-functions/BaseFunctions/R/Dockerfile index c00c148d..f972a3c0 100644 --- a/sample-functions/BaseFunctions/R/Dockerfile +++ b/sample-functions/BaseFunctions/R/Dockerfile @@ -1,4 +1,4 @@ -FROM openfaas/classic-watchdog:0.18.8 as watchdog +FROM ghcr.io/openfaas/classic-watchdog:0.2.0 as watchdog FROM artemklevtsov/r-alpine:latest diff --git a/sample-functions/BaseFunctions/coffee/Dockerfile b/sample-functions/BaseFunctions/coffee/Dockerfile index 875edadc..276874cc 100644 --- a/sample-functions/BaseFunctions/coffee/Dockerfile +++ b/sample-functions/BaseFunctions/coffee/Dockerfile @@ -1,4 +1,4 @@ -FROM openfaas/classic-watchdog:0.18.8 as watchdog +FROM ghcr.io/openfaas/classic-watchdog:0.2.0 as watchdog FROM node:6.9.1-alpine diff --git a/sample-functions/BaseFunctions/dncore/Dockerfile b/sample-functions/BaseFunctions/dncore/Dockerfile index 70530783..cf03544f 100644 --- a/sample-functions/BaseFunctions/dncore/Dockerfile +++ b/sample-functions/BaseFunctions/dncore/Dockerfile @@ -1,4 +1,4 @@ -FROM openfaas/classic-watchdog:0.18.8 as watchdog +FROM ghcr.io/openfaas/classic-watchdog:0.2.0 as watchdog FROM mcr.microsoft.com/dotnet/core/sdk:2.1 as build diff --git a/sample-functions/BaseFunctions/golang/Dockerfile b/sample-functions/BaseFunctions/golang/Dockerfile index d91ef7ae..85c78fa7 100644 --- a/sample-functions/BaseFunctions/golang/Dockerfile +++ b/sample-functions/BaseFunctions/golang/Dockerfile @@ -1,4 +1,4 @@ -FROM openfaas/classic-watchdog:0.18.8 as watchdog +FROM ghcr.io/openfaas/classic-watchdog:0.2.0 as watchdog FROM golang:1.13-alpine ENV CGO_ENABLED=0 diff --git a/sample-functions/BaseFunctions/java/Dockerfile b/sample-functions/BaseFunctions/java/Dockerfile index 8937078d..9eed3c4f 100644 --- a/sample-functions/BaseFunctions/java/Dockerfile +++ b/sample-functions/BaseFunctions/java/Dockerfile @@ -1,4 +1,4 @@ -FROM openfaas/classic-watchdog:0.18.8 as watchdog +FROM ghcr.io/openfaas/classic-watchdog:0.2.0 as watchdog FROM openjdk:8u121-jdk-alpine diff --git a/sample-functions/BaseFunctions/node/Dockerfile b/sample-functions/BaseFunctions/node/Dockerfile index 7ede81ed..274552a9 100644 --- a/sample-functions/BaseFunctions/node/Dockerfile +++ b/sample-functions/BaseFunctions/node/Dockerfile @@ -1,4 +1,4 @@ -FROM openfaas/classic-watchdog:0.18.8 as watchdog +FROM ghcr.io/openfaas/classic-watchdog:0.2.0 as watchdog FROM node:6.9.1-alpine diff --git a/sample-functions/BaseFunctions/python/Dockerfile b/sample-functions/BaseFunctions/python/Dockerfile index b11e69cb..c3133a78 100644 --- a/sample-functions/BaseFunctions/python/Dockerfile +++ b/sample-functions/BaseFunctions/python/Dockerfile @@ -1,4 +1,4 @@ -FROM openfaas/classic-watchdog:0.18.8 as watchdog +FROM ghcr.io/openfaas/classic-watchdog:0.2.0 as watchdog FROM python:2.7-alpine diff --git a/sample-functions/CHelloWorld/src/Dockerfile b/sample-functions/CHelloWorld/src/Dockerfile index e69bee85..77d8e9b5 100644 --- a/sample-functions/CHelloWorld/src/Dockerfile +++ b/sample-functions/CHelloWorld/src/Dockerfile @@ -1,6 +1,6 @@ -FROM openfaas/classic-watchdog:0.18.8 as watchdog +FROM ghcr.io/openfaas/classic-watchdog:0.2.0 as watchdog -FROM alpine:3.14 as builder +FROM alpine:3.15 as builder COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog RUN chmod +x /usr/bin/fwatchdog diff --git a/sample-functions/CaptainsIntent/Dockerfile b/sample-functions/CaptainsIntent/Dockerfile index 0126863b..571faaab 100644 --- a/sample-functions/CaptainsIntent/Dockerfile +++ b/sample-functions/CaptainsIntent/Dockerfile @@ -1,6 +1,6 @@ -FROM openfaas/classic-watchdog:0.18.8 as watchdog +FROM ghcr.io/openfaas/classic-watchdog:0.2.0 as watchdog -FROM alpine:3.14 +FROM alpine:3.15 as ship RUN apk --update add nodejs nodejs-npm COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog diff --git a/sample-functions/ChangeColorIntent/Dockerfile b/sample-functions/ChangeColorIntent/Dockerfile index 81afe0d3..4abe3a5b 100644 --- a/sample-functions/ChangeColorIntent/Dockerfile +++ b/sample-functions/ChangeColorIntent/Dockerfile @@ -1,6 +1,6 @@ -FROM openfaas/classic-watchdog:0.18.8 as watchdog +FROM ghcr.io/openfaas/classic-watchdog:0.2.0 as watchdog -FROM alpine:3.14 +FROM alpine:3.15 as ship RUN apk --update add nodejs nodejs-npm COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog diff --git a/sample-functions/DockerHubStats/Dockerfile b/sample-functions/DockerHubStats/Dockerfile index a58fd679..019fc81f 100644 --- a/sample-functions/DockerHubStats/Dockerfile +++ b/sample-functions/DockerHubStats/Dockerfile @@ -1,4 +1,4 @@ -FROM openfaas/classic-watchdog:0.18.8 as watchdog +FROM ghcr.io/openfaas/classic-watchdog:0.2.0 as watchdog FROM golang:1.13-alpine as builder ENV CGO_ENABLED=0 @@ -10,7 +10,7 @@ WORKDIR /go/src/github.com/openfaas/faas/sample-functions/DockerHubStats COPY . /go/src/github.com/openfaas/faas/sample-functions/DockerHubStats RUN set -ex && apk add make && make install -FROM alpine:3.14 +FROM alpine:3.15 as ship # Needed to reach the hub RUN apk --no-cache add ca-certificates diff --git a/sample-functions/DockerHubStats/Dockerfile.armhf b/sample-functions/DockerHubStats/Dockerfile.armhf index 0e3f5ebf..79c2943e 100644 --- a/sample-functions/DockerHubStats/Dockerfile.armhf +++ b/sample-functions/DockerHubStats/Dockerfile.armhf @@ -13,7 +13,7 @@ COPY . /go/src/github.com/openfaas/faas/sample-functions/DockerHubStats RUN make install -FROM alpine:3.14 +FROM alpine:3.15 as ship # Needed to reach the hub RUN apk --no-cache add ca-certificates diff --git a/sample-functions/MarkdownRender/Dockerfile b/sample-functions/MarkdownRender/Dockerfile index 60d2b6ba..de0ae245 100644 --- a/sample-functions/MarkdownRender/Dockerfile +++ b/sample-functions/MarkdownRender/Dockerfile @@ -1,4 +1,4 @@ -FROM openfaas/classic-watchdog:0.18.8 as watchdog +FROM ghcr.io/openfaas/classic-watchdog:0.2.0 as watchdog FROM golang:1.13-alpine as builder ENV CGO_ENABLED=0 @@ -13,7 +13,7 @@ COPY vendor vendor RUN go install -FROM alpine:3.14 +FROM alpine:3.15 as ship COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog RUN chmod +x /usr/bin/fwatchdog diff --git a/sample-functions/Nmap/Dockerfile b/sample-functions/Nmap/Dockerfile index 1641b8d6..39a833c1 100644 --- a/sample-functions/Nmap/Dockerfile +++ b/sample-functions/Nmap/Dockerfile @@ -1,6 +1,6 @@ -FROM openfaas/classic-watchdog:0.18.8 as watchdog +FROM ghcr.io/openfaas/classic-watchdog:0.2.0 as watchdog -FROM alpine:3.14 +FROM alpine:3.15 as ship COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog RUN chmod +x /usr/bin/fwatchdog diff --git a/sample-functions/Phantomjs/Dockerfile b/sample-functions/Phantomjs/Dockerfile index b7555473..9f24a4d3 100644 --- a/sample-functions/Phantomjs/Dockerfile +++ b/sample-functions/Phantomjs/Dockerfile @@ -1,4 +1,4 @@ -FROM openfaas/classic-watchdog:0.18.8 as watchdog +FROM ghcr.io/openfaas/classic-watchdog:0.2.0 as watchdog FROM alexellis2/phantomjs-docker:latest diff --git a/sample-functions/README.md b/sample-functions/README.md index 10ec543c..d938a644 100644 --- a/sample-functions/README.md +++ b/sample-functions/README.md @@ -1,3 +1,7 @@ +## Note: this page contains legacy examples. + +To learn how to build functions, see the official training page in the docs: [Training](https://docs.openfaas.com/tutorials/training/) + ## Hello World in different languages: For examples of hello-world in different programming languages see inside the BaseFunctions folder: diff --git a/sample-functions/ResizeImageMagick/Dockerfile b/sample-functions/ResizeImageMagick/Dockerfile index 0adfb4ac..f5aeec2f 100644 --- a/sample-functions/ResizeImageMagick/Dockerfile +++ b/sample-functions/ResizeImageMagick/Dockerfile @@ -1,4 +1,4 @@ -FROM openfaas/classic-watchdog:0.18.8 as watchdog +FROM ghcr.io/openfaas/classic-watchdog:0.2.0 as watchdog FROM v4tech/imagemagick diff --git a/sample-functions/ResizeImageMagick/Dockerfile.armhf b/sample-functions/ResizeImageMagick/Dockerfile.armhf index c4d78d70..51b9457e 100644 --- a/sample-functions/ResizeImageMagick/Dockerfile.armhf +++ b/sample-functions/ResizeImageMagick/Dockerfile.armhf @@ -1,6 +1,6 @@ -FROM openfaas/classic-watchdog:0.18.8 as watchdog +FROM ghcr.io/openfaas/classic-watchdog:0.2.0 as watchdog -FROM arm32v6/alpine:3.14 +FROM arm32v6/alpine:3.15 RUN apk --no-cache add imagemagick diff --git a/sample-functions/SentimentAnalysis/Dockerfile b/sample-functions/SentimentAnalysis/Dockerfile index 1a34f126..590fca0e 100644 --- a/sample-functions/SentimentAnalysis/Dockerfile +++ b/sample-functions/SentimentAnalysis/Dockerfile @@ -1,4 +1,4 @@ -FROM openfaas/classic-watchdog:0.18.8 as watchdog +FROM ghcr.io/openfaas/classic-watchdog:0.2.0 as watchdog FROM python:2.7-alpine diff --git a/sample-functions/SentimentAnalysis/Dockerfile.armhf b/sample-functions/SentimentAnalysis/Dockerfile.armhf index 660cb01f..71c8f9da 100644 --- a/sample-functions/SentimentAnalysis/Dockerfile.armhf +++ b/sample-functions/SentimentAnalysis/Dockerfile.armhf @@ -1,4 +1,4 @@ -FROM openfaas/classic-watchdog:0.18.8 as watchdog +FROM ghcr.io/openfaas/classic-watchdog:0.2.0 as watchdog FROM arm32v7/python:2.7-slim diff --git a/sample-functions/WebhookStash/Dockerfile b/sample-functions/WebhookStash/Dockerfile index 91cb4b87..39647c1d 100644 --- a/sample-functions/WebhookStash/Dockerfile +++ b/sample-functions/WebhookStash/Dockerfile @@ -1,4 +1,4 @@ -FROM openfaas/classic-watchdog:0.18.8 as watchdog +FROM ghcr.io/openfaas/classic-watchdog:0.2.0 as watchdog FROM golang:1.13-alpine as builder ENV CGO_ENABLED=0 @@ -12,7 +12,7 @@ COPY handler.go . RUN go install -FROM alpine:3.14 +FROM alpine:3.15 as ship COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog RUN chmod +x /usr/bin/fwatchdog diff --git a/sample-functions/hey/Dockerfile b/sample-functions/hey/Dockerfile index ed774800..3504e3b4 100644 --- a/sample-functions/hey/Dockerfile +++ b/sample-functions/hey/Dockerfile @@ -1,6 +1,6 @@ -FROM openfaas/classic-watchdog:0.18.1 as watchdog +FROM ghcr.io/openfaas/classic-watchdog:0.2.0 as watchdog -FROM alpine:3.14 +FROM alpine:3.15 as ship RUN mkdir -p /home/app