Files
faas/sample-functions/CHelloWorld/src/Dockerfile
Alex Ellis 8ef52ce806 Update Dockerfiles to latest watchdog
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2019-04-22 10:28:22 +01:00

29 lines
612 B
Docker

FROM alpine:3.8 as builder
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/
RUN apk add --no-cache gcc \
musl-dev
COPY main.c .
RUN gcc main.c -static -o /main \
&& chmod +x /main \
&& /main
FROM scratch
COPY --from=builder /main /
COPY --from=builder /usr/bin/fwatchdog /
COPY --from=builder /tmp /tmp
ENV fprocess="/main"
HEALTHCHECK --interval=5s CMD [ -e /tmp/.lock ] || exit 1
CMD ["/fwatchdog"]