mirror of
https://github.com/openfaas/faas.git
synced 2025-06-09 16:56:47 +00:00
Use builder pattern in ApiKeyProtected-Secrets
Signed-off-by: Lucas Roesler <roesler.lucas@gmail.com>
This commit is contained in:
parent
4fb53be0e4
commit
5f30c7570f
@ -1,23 +1,26 @@
|
|||||||
FROM golang:1.7.5 as builder
|
FROM golang:1.9.2-alpine as builder
|
||||||
RUN mkdir -p /go/src/app
|
|
||||||
COPY handler.go /go/src/app
|
|
||||||
WORKDIR /go/src/app
|
|
||||||
|
|
||||||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app .
|
MAINTAINER alex@openfaas.com
|
||||||
|
ENTRYPOINT []
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
FROM alpine:latest
|
WORKDIR /go/src/github.com/openfaas/faas/sample-functions/ApiKeyProtected
|
||||||
|
|
||||||
WORKDIR /root/
|
COPY handler.go .
|
||||||
|
# COPY vendor vendor
|
||||||
|
|
||||||
EXPOSE 8080
|
RUN go install
|
||||||
ENV http_proxy ""
|
|
||||||
ENV https_proxy ""
|
|
||||||
|
|
||||||
ADD https://github.com/alexellis/faas/releases/download/0.6.6d/fwatchdog /usr/bin
|
FROM alpine:3.6
|
||||||
RUN chmod +x /usr/bin/fwatchdog
|
|
||||||
|
|
||||||
COPY --from=builder /go/src/app/app .
|
# Needed to reach the hub
|
||||||
|
RUN apk --no-cache add ca-certificates
|
||||||
|
|
||||||
ENV fprocess="/root/app"
|
COPY --from=builder /usr/bin/fwatchdog /usr/bin/fwatchdog
|
||||||
CMD ["fwatchdog"]
|
COPY --from=builder /go/bin/ApiKeyProtected /usr/bin/ApiKeyProtected
|
||||||
|
ENV fprocess "/usr/bin/ApiKeyProtected"
|
||||||
|
|
||||||
|
CMD ["/usr/bin/fwatchdog"]
|
||||||
|
Binary file not shown.
@ -1,3 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
echo Building functions/api-key-protected:latest
|
|
||||||
docker build --no-cache -t functions/api-key-protected:latest .
|
|
Loading…
x
Reference in New Issue
Block a user