mirror of
https://github.com/openfaas/faas.git
synced 2025-06-20 04:56:38 +00:00
Bump samples/versions - reduce image sizes through multi-stage builds
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
This commit is contained in:
@ -1,16 +1,26 @@
|
||||
FROM alpine:latest
|
||||
FROM golang:1.9.2-alpine as builder
|
||||
|
||||
WORKDIR /root/
|
||||
MAINTAINER alex@openfaas.com
|
||||
ENTRYPOINT []
|
||||
|
||||
EXPOSE 8080
|
||||
ENV http_proxy ""
|
||||
ENV https_proxy ""
|
||||
RUN apk --no-cache add make curl \
|
||||
&& curl -sL https://github.com/openfaas/faas/releases/download/0.6.9/fwatchdog > /usr/bin/fwatchdog \
|
||||
&& chmod +x /usr/bin/fwatchdog
|
||||
|
||||
ADD https://github.com/openfaas/faas/releases/download/v0.5-alpha/fwatchdog /usr/bin
|
||||
RUN chmod +x /usr/bin/fwatchdog
|
||||
# COPY fwatchdog /usr/bin/
|
||||
WORKDIR /go/src/github.com/openfaas/faas/sample-functions/WebhookStash
|
||||
|
||||
COPY app .
|
||||
COPY handler.go .
|
||||
# COPY vendor vendor
|
||||
|
||||
ENV fprocess="/root/app"
|
||||
CMD ["fwatchdog"]
|
||||
RUN go install
|
||||
|
||||
FROM alpine:3.6
|
||||
|
||||
# Needed to reach the hub
|
||||
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
|
||||
ENV fprocess "/usr/bin/WebhookStash"
|
||||
|
||||
CMD ["/usr/bin/fwatchdog"]
|
||||
|
Reference in New Issue
Block a user