Non root user and fwatchdow standarization

AlpineFunction additional Dockerfiles
Fix Coffe, node nonroot user and change workdir
DnCore nonroot and updated to 2.1, new README
Fix golang user and watchdog
Java user and watchdog fix
Watchdog and user for node image
Fix python user and watchdog
Fix R username and watchdog
Captainsintent user and fwatchdog
ChangeColorIntent change username, fwatchdog and directory
CHelloWorld remove tmp, disabled lock, fwatchdog and user
DockerHubStats user, fwatchdog and dependencies
Change figlet to use base alpine image
Improve figlet ARM
Set base image GIF-Maker
MarkDownRender change base image
NodeInfo change base image
PhantomJS user and fwatchdog
Resize Image
SentimentAnalysis user and watchdog
WebhookStach change root image
Replace user faas with app
Upgrade alpine to latest version
Revert vendor folders
Upgrade alpine:3.9
This commit is contained in:
Pau Rosello 2019-06-26 11:35:02 +02:00 committed by Alex Ellis
parent e8b3818300
commit 2b37a0133a
31 changed files with 181 additions and 150 deletions

View File

@ -1,6 +1,6 @@
FROM openfaas/classic-watchdog:0.14.4 as watchdog FROM openfaas/classic-watchdog:0.14.4 as watchdog
FROM alpine:3.9 FROM alpine:3.10
COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog
RUN chmod +x /usr/bin/fwatchdog RUN chmod +x /usr/bin/fwatchdog
@ -8,5 +8,8 @@ RUN chmod +x /usr/bin/fwatchdog
# Populate example here # Populate example here
# ENV fprocess="wc -l" # ENV fprocess="wc -l"
RUN addgroup -g 1000 -S app && adduser -u 1000 -S app -G app
USER 1000
HEALTHCHECK --interval=5s CMD [ -e /tmp/.lock ] || exit 1 HEALTHCHECK --interval=5s CMD [ -e /tmp/.lock ] || exit 1
CMD ["fwatchdog"] CMD ["fwatchdog"]

View File

@ -1,6 +1,6 @@
FROM openfaas/classic-watchdog:0.14.4 as watchdog FROM openfaas/classic-watchdog:0.14.4 as watchdog
FROM alpine:3.9 FROM alpine:3.10
COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog
RUN chmod +x /usr/bin/fwatchdog RUN chmod +x /usr/bin/fwatchdog
@ -8,5 +8,8 @@ RUN chmod +x /usr/bin/fwatchdog
# Populate example here # Populate example here
# ENV fprocess="wc -l" # ENV fprocess="wc -l"
RUN addgroup -g 1000 -S app && adduser -u 1000 -S app -G app
USER 1000
HEALTHCHECK --interval=5s CMD [ -e /tmp/.lock ] || exit 1 HEALTHCHECK --interval=5s CMD [ -e /tmp/.lock ] || exit 1
CMD ["fwatchdog"] CMD ["fwatchdog"]

View File

@ -1,6 +1,6 @@
FROM openfaas/classic-watchdog:0.14.4 as watchdog FROM openfaas/classic-watchdog:0.14.4 as watchdog
FROM alpine:3.9 FROM alpine:3.10
COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog
RUN chmod +x /usr/bin/fwatchdog RUN chmod +x /usr/bin/fwatchdog
@ -8,5 +8,8 @@ RUN chmod +x /usr/bin/fwatchdog
# Populate example here # Populate example here
# ENV fprocess="wc -l" # ENV fprocess="wc -l"
RUN addgroup -g 1000 -S app && adduser -u 1000 -S app -G app
USER 1000
HEALTHCHECK --interval=5s CMD [ -e /tmp/.lock ] || exit 1 HEALTHCHECK --interval=5s CMD [ -e /tmp/.lock ] || exit 1
CMD ["fwatchdog"] CMD ["fwatchdog"]

View File

@ -1,16 +1,19 @@
FROM openfaas/classic-watchdog:0.14.4 as watchdog
FROM artemklevtsov/r-alpine:latest FROM artemklevtsov/r-alpine:latest
RUN apk --no-cache add curl \ COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog
&& curl -sL https://github.com/openfaas/faas/releases/download/0.13.0/fwatchdog > /usr/bin/fwatchdog \ RUN chmod +x /usr/bin/fwatchdog
&& chmod +x /usr/bin/fwatchdog
WORKDIR /root/ WORKDIR /application/
COPY handler.R . COPY handler.R .
ENV fprocess="Rscript handler.R" ENV fprocess="Rscript handler.R"
RUN addgroup -g 1000 -S app && adduser -u 1000 -S app -G app
USER 1000
HEALTHCHECK --interval=1s CMD [ -e /tmp/.lock ] || exit 1 HEALTHCHECK --interval=1s CMD [ -e /tmp/.lock ] || exit 1
CMD ["fwatchdog"] CMD ["fwatchdog"]

View File

@ -1,10 +1,11 @@
FROM openfaas/classic-watchdog:0.14.4 as watchdog
FROM node:6.9.1-alpine FROM node:6.9.1-alpine
RUN apk --no-cache add curl \ COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog
&& curl -sL https://github.com/openfaas/faas/releases/download/0.13.0/fwatchdog > /usr/bin/fwatchdog \ RUN chmod +x /usr/bin/fwatchdog
&& chmod +x /usr/bin/fwatchdog
WORKDIR /root/ WORKDIR /application/
COPY package.json . COPY package.json .
@ -17,4 +18,6 @@ ENV fprocess="coffee handler.coffee"
HEALTHCHECK --interval=1s CMD [ -e /tmp/.lock ] || exit 1 HEALTHCHECK --interval=1s CMD [ -e /tmp/.lock ] || exit 1
USER 1000
CMD ["fwatchdog"] CMD ["fwatchdog"]

View File

@ -1,18 +1,21 @@
FROM microsoft/dotnet:sdk FROM openfaas/classic-watchdog:0.14.4 as watchdog
RUN apt-get update && apt-get install -y curl \ FROM mcr.microsoft.com/dotnet/core/sdk:2.1 as build
&& curl -sL https://github.com/openfaas/faas/releases/download/0.13.0/fwatchdog > /usr/bin/fwatchdog \
&& chmod +x /usr/bin/fwatchdog \ COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* RUN chmod +x /usr/bin/fwatchdog
ENV DOTNET_CLI_TELEMETRY_OPTOUT 1 ENV DOTNET_CLI_TELEMETRY_OPTOUT 1
WORKDIR /root/ WORKDIR /application/
COPY src src COPY src src
WORKDIR /root/src WORKDIR /application/src
RUN dotnet restore RUN dotnet restore
RUN dotnet build RUN dotnet build
ENV fprocess="dotnet ./bin/Debug/netcoreapp1.1/root.dll" FROM build as runner
RUN groupadd -g 1000 -r faas && useradd -r -g faas -u 1000 faas -m
USER 1000
ENV fprocess="dotnet ./bin/Debug/netcoreapp2.1/root.dll"
EXPOSE 8080 EXPOSE 8080
CMD ["fwatchdog"] CMD ["fwatchdog"]

View File

@ -0,0 +1,9 @@
# DnCore Example
DotNet seems to have an issue where the following message can bee seen on STDOUT:
```
realpath(): Permission denied
realpath(): Permission denied
realpath(): Permission denied
```
This messages can be ignored and the issue can be followed at: https://github.com/dotnet/core-setup/issues/4038

View File

@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFramework>netcoreapp1.1</TargetFramework> <TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

View File

@ -1,3 +1,5 @@
FROM openfaas/classic-watchdog:0.14.4 as watchdog
FROM golang:1.9.7-alpine FROM golang:1.9.7-alpine
MAINTAINER alexellis2@gmail.com MAINTAINER alexellis2@gmail.com
@ -8,11 +10,13 @@ COPY . /go/src/github.com/openfaas/faas/sample-functions/golang
RUN go install RUN go install
RUN apk --no-cache add curl \ COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog
&& curl -sL https://github.com/openfaas/faas/releases/download/0.13.0/fwatchdog > /usr/bin/fwatchdog \ RUN chmod +x /usr/bin/fwatchdog
&& chmod +x /usr/bin/fwatchdog
ENV fprocess "/go/bin/golang" ENV fprocess "/go/bin/golang"
HEALTHCHECK --interval=1s CMD [ -e /tmp/.lock ] || exit 1 HEALTHCHECK --interval=1s CMD [ -e /tmp/.lock ] || exit 1
CMD [ "/usr/bin/fwatchdog"] RUN addgroup -g 1000 -S app && adduser -u 1000 -S app -G app
USER 1000
CMD [ "fwatchdog"]

View File

@ -1,16 +1,20 @@
FROM openfaas/classic-watchdog:0.14.4 as watchdog
FROM openjdk:8u121-jdk-alpine FROM openjdk:8u121-jdk-alpine
RUN apk --no-cache add curl \ COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog
&& curl -sL https://github.com/openfaas/faas/releases/download/0.13.0/fwatchdog > /usr/bin/fwatchdog \ RUN chmod +x /usr/bin/fwatchdog
&& chmod +x /usr/bin/fwatchdog
WORKDIR /root/ WORKDIR /application/
COPY Handler.java . COPY Handler.java .
RUN javac Handler.java RUN javac Handler.java
ENV fprocess="java Handler" ENV fprocess="java Handler"
RUN addgroup -g 1000 -S app && adduser -u 1000 -S app -G app
USER 1000
HEALTHCHECK --interval=1s CMD [ -e /tmp/.lock ] || exit 1 HEALTHCHECK --interval=1s CMD [ -e /tmp/.lock ] || exit 1
CMD ["fwatchdog"] CMD ["fwatchdog"]

View File

@ -1,15 +1,19 @@
FROM openfaas/classic-watchdog:0.14.4 as watchdog
FROM node:6.9.1-alpine FROM node:6.9.1-alpine
RUN apk --no-cache add curl \ COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog
&& curl -sL https://github.com/openfaas/faas/releases/download/0.13.0/fwatchdog > /usr/bin/fwatchdog \ RUN chmod +x /usr/bin/fwatchdog
&& chmod +x /usr/bin/fwatchdog
WORKDIR /root/ WORKDIR /application/
COPY package.json . COPY package.json .
RUN npm i RUN npm i
COPY handler.js . COPY handler.js .
USER 1000
ENV fprocess="node handler.js" ENV fprocess="node handler.js"
HEALTHCHECK --interval=1s CMD [ -e /tmp/.lock ] || exit 1 HEALTHCHECK --interval=1s CMD [ -e /tmp/.lock ] || exit 1

View File

@ -1,15 +1,19 @@
FROM openfaas/classic-watchdog:0.14.4 as watchdog
FROM python:2.7-alpine FROM python:2.7-alpine
RUN apk --no-cache add curl \ COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog
&& curl -sL https://github.com/openfaas/faas/releases/download/0.13.0/fwatchdog > /usr/bin/fwatchdog \ RUN chmod +x /usr/bin/fwatchdog
&& chmod +x /usr/bin/fwatchdog
WORKDIR /root/ WORKDIR /application/
COPY handler.py . COPY handler.py .
ENV fprocess="python handler.py" ENV fprocess="python handler.py"
RUN addgroup -g 1000 -S app && adduser -u 1000 -S app -G app
USER 1000
HEALTHCHECK --interval=1s CMD [ -e /tmp/.lock ] || exit 1 HEALTHCHECK --interval=1s CMD [ -e /tmp/.lock ] || exit 1
CMD ["fwatchdog"] CMD ["fwatchdog"]

View File

@ -1,10 +1,12 @@
FROM alpine:3.8 as builder FROM openfaas/classic-watchdog:0.14.4 as watchdog
RUN apk add --no-cache curl \
&& curl -SL https://github.com/openfaas/faas/releases/download/0.13.0/fwatchdog > /usr/bin/fwatchdog \
&& chmod +x /usr/bin/fwatchdog \
&& apk --no-cache del curl
WORKDIR /root/ FROM alpine:3.10 as builder
COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog
RUN chmod +x /usr/bin/fwatchdog
WORKDIR /application/
RUN addgroup -g 1000 -S app && adduser -u 1000 -S app -G app
RUN apk add --no-cache gcc \ RUN apk add --no-cache gcc \
musl-dev musl-dev
@ -18,11 +20,13 @@ FROM scratch
COPY --from=builder /main / COPY --from=builder /main /
COPY --from=builder /usr/bin/fwatchdog / COPY --from=builder /usr/bin/fwatchdog /
COPY --from=builder /tmp /tmp
ENV fprocess="/main" ENV fprocess="/main"
ENV suppress_lock=true
HEALTHCHECK --interval=5s CMD [ -e /tmp/.lock ] || exit 1 COPY --from=builder /etc/passwd /etc/passwd
CMD ["/fwatchdog"] USER 1000
CMD ["fwatchdog"]

View File

@ -1,9 +1,12 @@
FROM alpine:3.8 FROM openfaas/classic-watchdog:0.14.4 as watchdog
FROM alpine:3.10
RUN apk --update add nodejs nodejs-npm RUN apk --update add nodejs nodejs-npm
RUN apk --no-cache add curl \ COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog
&& curl -sL https://github.com/openfaas/faas/releases/download/0.13.0/fwatchdog > /usr/bin/fwatchdog \ RUN chmod +x /usr/bin/fwatchdog
&& chmod +x /usr/bin/fwatchdog
WORKDIR /application/
COPY package.json . COPY package.json .
COPY handler.js . COPY handler.js .
@ -12,4 +15,7 @@ COPY sample.json .
RUN npm i RUN npm i
ENV fprocess="node handler.js" ENV fprocess="node handler.js"
USER 1000
CMD ["fwatchdog"] CMD ["fwatchdog"]

View File

@ -1,9 +1,12 @@
FROM alpine:3.8 FROM openfaas/classic-watchdog:0.14.4 as watchdog
FROM alpine:3.10
RUN apk --update add nodejs nodejs-npm RUN apk --update add nodejs nodejs-npm
RUN apk --no-cache add curl \ COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog
&& curl -sL https://github.com/openfaas/faas/releases/download/0.13.0/fwatchdog > /usr/bin/fwatchdog \ RUN chmod +x /usr/bin/fwatchdog
&& chmod +x /usr/bin/fwatchdog
WORKDIR /application/
COPY package.json . COPY package.json .
RUN npm i RUN npm i
@ -11,6 +14,7 @@ COPY handler.js .
COPY sendColor.js . COPY sendColor.js .
COPY sample_response.json . COPY sample_response.json .
USER 1000
ENV fprocess="node handler.js" ENV fprocess="node handler.js"
CMD ["fwatchdog"] CMD ["fwatchdog"]

View File

@ -1,26 +1,26 @@
FROM openfaas/classic-watchdog:0.14.4 as watchdog
FROM golang:1.9.7-alpine as builder FROM golang:1.9.7-alpine as builder
MAINTAINER alex@openfaas.com MAINTAINER alex@openfaas.com
ENTRYPOINT [] ENTRYPOINT []
RUN apk --no-cache add make curl \
&& curl -sL https://github.com/openfaas/faas/releases/download/0.13.0/fwatchdog > /usr/bin/fwatchdog \
&& chmod +x /usr/bin/fwatchdog
WORKDIR /go/src/github.com/openfaas/faas/sample-functions/DockerHubStats WORKDIR /go/src/github.com/openfaas/faas/sample-functions/DockerHubStats
COPY . /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
RUN make install FROM alpine:3.10
FROM alpine:3.8
# Needed to reach the hub # Needed to reach the hub
RUN apk --no-cache add ca-certificates RUN apk --no-cache add ca-certificates
COPY --from=builder /usr/bin/fwatchdog /usr/bin/fwatchdog COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog
RUN chmod +x /usr/bin/fwatchdog
COPY --from=builder /go/bin/DockerHubStats /usr/bin/DockerHubStats COPY --from=builder /go/bin/DockerHubStats /usr/bin/DockerHubStats
ENV fprocess "/usr/bin/DockerHubStats" ENV fprocess "/usr/bin/DockerHubStats"
RUN addgroup -g 1000 -S app && adduser -u 1000 -S app -G app
USER 1000
HEALTHCHECK --interval=5s CMD [ -e /tmp/.lock ] || exit 1 HEALTHCHECK --interval=5s CMD [ -e /tmp/.lock ] || exit 1
CMD ["/usr/bin/fwatchdog"] CMD ["/usr/bin/fwatchdog"]

View File

@ -13,7 +13,7 @@ COPY . /go/src/github.com/openfaas/faas/sample-functions/DockerHubStats
RUN make install RUN make install
FROM alpine:3.8 FROM alpine:3.10
# Needed to reach the hub # Needed to reach the hub
RUN apk --no-cache add ca-certificates RUN apk --no-cache add ca-certificates

View File

@ -1,10 +1,6 @@
FROM alpine:3.8 FROM functions/alpine:latest
RUN apk --update add nodejs nodejs-npm 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 package.json .
COPY handler.js . COPY handler.js .
COPY sample.json . COPY sample.json .

View File

@ -3,10 +3,6 @@ FROM golang:1.9.7-alpine as builder
MAINTAINER alex@openfaas.com MAINTAINER alex@openfaas.com
ENTRYPOINT [] ENTRYPOINT []
RUN apk --no-cache add make curl \
&& curl -sL https://github.com/openfaas/faas/releases/download/0.13.0/fwatchdog > /usr/bin/fwatchdog \
&& chmod +x /usr/bin/fwatchdog
WORKDIR /go/src/github.com/openfaas/faas/sample-functions/MarkdownRender WORKDIR /go/src/github.com/openfaas/faas/sample-functions/MarkdownRender
COPY handler.go . COPY handler.go .
@ -14,12 +10,11 @@ COPY vendor vendor
RUN go install RUN go install
FROM alpine:3.8 FROM functions/alpine:latest
# Needed to reach the hub # Needed to reach the hub
RUN apk --no-cache add ca-certificates RUN apk --no-cache add ca-certificates
COPY --from=builder /usr/bin/fwatchdog /usr/bin/fwatchdog
COPY --from=builder /go/bin/MarkdownRender /usr/bin/MarkdownRender COPY --from=builder /go/bin/MarkdownRender /usr/bin/MarkdownRender
ENV fprocess "/usr/bin/MarkdownRender" ENV fprocess "/usr/bin/MarkdownRender"

View File

@ -1,9 +1,4 @@
FROM openfaas/classic-watchdog:0.14.4 as watchdog FROM functions/alpine:latest
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 --update add nodejs nodejs-npm

View File

@ -1,9 +1,4 @@
FROM openfaas/classic-watchdog:0.14.4 as watchdog FROM functions/alpine:latest
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 --update add nodejs nodejs-npm

View File

@ -1,9 +1,4 @@
FROM openfaas/classic-watchdog:0.14.4 as watchdog FROM functions/alpine:latest
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 --update add nodejs nodejs-npm

View File

@ -1,11 +1,14 @@
FROM openfaas/classic-watchdog:0.14.4 as watchdog
FROM alexellis2/phantomjs-docker:latest FROM alexellis2/phantomjs-docker:latest
RUN apt-get update && apt-get install -y curl \ COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog
&& curl -sL https://github.com/openfaas/faas/releases/download/0.13.0/fwatchdog > /usr/bin/fwatchdog \ RUN chmod +x /usr/bin/fwatchdog
&& chmod +x /usr/bin/fwatchdog \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ENV fprocess="phantomjs /dev/stdin" ENV fprocess="phantomjs /dev/stdin"
RUN addgroup -g 1000 -S app && adduser -u 1000 -S app -G app
USER 1000
HEALTHCHECK --interval=5s CMD [ -e /tmp/.lock ] || exit 1 HEALTHCHECK --interval=5s CMD [ -e /tmp/.lock ] || exit 1
CMD ["fwatchdog"] CMD ["fwatchdog"]

View File

@ -1,11 +1,15 @@
FROM openfaas/classic-watchdog:0.14.4 as watchdog
FROM v4tech/imagemagick FROM v4tech/imagemagick
RUN apk --no-cache add curl \ COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog
&& curl -sL https://github.com/openfaas/faas/releases/download/0.13.0/fwatchdog > /usr/bin/fwatchdog \ RUN chmod +x /usr/bin/fwatchdog
&& chmod +x /usr/bin/fwatchdog
ENV fprocess "convert - -resize 50% fd:1" ENV fprocess "convert - -resize 50% fd:1"
RUN addgroup -g 1000 -S app && adduser -u 1000 -S app -G app
USER 1000
EXPOSE 8080 EXPOSE 8080
CMD [ "/usr/bin/fwatchdog"] CMD [ "/usr/bin/fwatchdog"]

View File

@ -1,13 +1,17 @@
FROM arm32v6/alpine:3.8 FROM openfaas/classic-watchdog:0.14.4 as watchdog
FROM arm32v6/alpine:3.10
RUN apk --no-cache add imagemagick RUN apk --no-cache add imagemagick
RUN apk --no-cache add curl \ COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog
&& curl -sL https://github.com/openfaas/faas/releases/download/0.13.0/fwatchdog-armhf > /usr/bin/fwatchdog \ RUN chmod +x /usr/bin/fwatchdog
&& chmod +x /usr/bin/fwatchdog
ENV fprocess "convert - -resize 50% fd:1" ENV fprocess "convert - -resize 50% fd:1"
RUN addgroup -g 1000 -S app && adduser -u 1000 -S app -G app
USER 1000
EXPOSE 8080 EXPOSE 8080
HEALTHCHECK --interval=1s CMD [ -e /tmp/.lock ] || exit 1 HEALTHCHECK --interval=1s CMD [ -e /tmp/.lock ] || exit 1

View File

@ -1,18 +1,18 @@
FROM openfaas/classic-watchdog:0.14.4 as watchdog
FROM python:2.7-alpine FROM python:2.7-alpine
RUN pip install textblob && \ RUN pip install textblob && \
python -m textblob.download_corpora python -m textblob.download_corpora
RUN apk --no-cache add curl \ COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog
&& curl -sL https://github.com/openfaas/faas/releases/download/0.13.0/fwatchdog > /usr/bin/fwatchdog \ RUN chmod +x /usr/bin/fwatchdog
&& chmod +x /usr/bin/fwatchdog
RUN addgroup -S app \ RUN addgroup -g 1000 -S app && adduser -u 1000 -S app -G app
&& adduser -S -g app app USER 1000
WORKDIR /home/app WORKDIR /home/app
USER app
COPY requirements.txt . COPY requirements.txt .
RUN pip install -r requirements.txt RUN pip install -r requirements.txt

View File

@ -1,19 +1,28 @@
FROM openfaas/classic-watchdog:0.14.4 as watchdog
FROM arm32v7/python:2.7-slim FROM arm32v7/python:2.7-slim
RUN pip install textblob && \ RUN pip install textblob && \
python -m textblob.download_corpora python -m textblob.download_corpora
RUN apt-get update && apt-get install -y curl \ COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog
&& curl -sL https://github.com/openfaas/faas/releases/download/0.13.0/fwatchdog-armhf > /usr/bin/fwatchdog \ RUN chmod +x /usr/bin/fwatchdog
&& chmod +x /usr/bin/fwatchdog \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
WORKDIR /root/ RUN addgroup -g 1000 -S app && adduser -u 1000 -S app -G app
USER 1000
WORKDIR /home/app
COPY requirements.txt .
RUN pip install -r requirements.txt
RUN python -m textblob.download_corpora
COPY handler.py . COPY handler.py .
ENV fprocess="python handler.py" ENV fprocess="python handler.py"
HEALTHCHECK --interval=1s CMD [ -e /tmp/.lock ] || exit 1 HEALTHCHECK --interval=3s CMD [ -e /tmp/.lock ] || exit 1
CMD ["fwatchdog"] CMD ["fwatchdog"]

View File

@ -3,10 +3,6 @@ FROM golang:1.9.7-alpine as builder
MAINTAINER alex@openfaas.com MAINTAINER alex@openfaas.com
ENTRYPOINT [] ENTRYPOINT []
RUN apk --no-cache add make curl \
&& curl -sL https://github.com/openfaas/faas/releases/download/0.13.0/fwatchdog > /usr/bin/fwatchdog \
&& chmod +x /usr/bin/fwatchdog
WORKDIR /go/src/github.com/openfaas/faas/sample-functions/WebhookStash WORKDIR /go/src/github.com/openfaas/faas/sample-functions/WebhookStash
COPY handler.go . COPY handler.go .
@ -14,12 +10,11 @@ COPY handler.go .
RUN go install RUN go install
FROM alpine:3.8 FROM functions/alpine:latest
# Needed to reach the hub # Needed to reach the hub
RUN apk --no-cache add ca-certificates RUN apk --no-cache add ca-certificates
COPY --from=builder /usr/bin/fwatchdog /usr/bin/fwatchdog
COPY --from=builder /go/bin/WebhookStash /usr/bin/WebhookStash COPY --from=builder /go/bin/WebhookStash /usr/bin/WebhookStash
ENV fprocess "/usr/bin/WebhookStash" ENV fprocess "/usr/bin/WebhookStash"

View File

@ -1,15 +1,8 @@
FROM openfaas/classic-watchdog:0.14.4 as watchdog FROM functions/alpine:latest
FROM alpine:3.9
COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog
RUN chmod +x /usr/bin/fwatchdog
RUN apk add --no-cache figlet RUN apk add --no-cache figlet
# Populate example here
ENV fprocess="figlet" ENV fprocess="figlet"
HEALTHCHECK --interval=5s CMD [ -e /tmp/.lock ] || exit 1 HEALTHCHECK --interval=5s CMD [ -e /tmp/.lock ] || exit 1
CMD ["fwatchdog"] CMD ["fwatchdog"]

View File

@ -1,15 +1,8 @@
FROM openfaas/classic-watchdog:0.14.4 as watchdog FROM functions/alpine:latest
FROM alpine:3.9
COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog
RUN chmod +x /usr/bin/fwatchdog
RUN apk add --no-cache figlet RUN apk add --no-cache figlet
# Populate example here
ENV fprocess="figlet" ENV fprocess="figlet"
HEALTHCHECK --interval=5s CMD [ -e /tmp/.lock ] || exit 1 HEALTHCHECK --interval=5s CMD [ -e /tmp/.lock ] || exit 1
CMD ["fwatchdog"] CMD ["fwatchdog"]

View File

@ -1,9 +1,6 @@
FROM alpine:3.8 FROM functions/alpine:latest
RUN apk --no-cache add ffmpeg gifsicle curl \ RUN apk add ffmpeg gifsicle
&& curl -LS https://github.com/openfaas/faas/releases/download/0.13.0/fwatchdog > /usr/bin/fwatchdog \
&& chmod +x /usr/bin/fwatchdog \
&& apk del curl
WORKDIR /root/ WORKDIR /root/
COPY entry.sh . COPY entry.sh .
ENV fprocess="./entry.sh" ENV fprocess="./entry.sh"