mirror of
https://github.com/openfaas/faas.git
synced 2025-06-19 04:26:35 +00:00
Make webhookstash a static binary
This commit is contained in:
1
sample-functions/WebhookStash/.gitignore
vendored
Normal file
1
sample-functions/WebhookStash/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
app
|
@ -1,15 +1,16 @@
|
||||
FROM golang:1.7.5
|
||||
RUN mkdir -p /go/src/app
|
||||
COPY handler.go /go/src/app
|
||||
WORKDIR /go/src/app
|
||||
RUN go get -d -v
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app .
|
||||
FROM alpine:latest
|
||||
|
||||
WORKDIR /root/
|
||||
|
||||
ADD https://github.com/alexellis/faas/releases/download/0.5.1-alpha/fwatchdog /usr/bin
|
||||
EXPOSE 8080
|
||||
ENV http_proxy ""
|
||||
ENV https_proxy ""
|
||||
|
||||
ADD https://github.com/alexellis/faas/releases/download/v0.5-alpha/fwatchdog /usr/bin
|
||||
RUN chmod +x /usr/bin/fwatchdog
|
||||
# COPY fwatchdog /usr/bin/
|
||||
|
||||
ENV fprocess="/go/src/app/app"
|
||||
COPY app .
|
||||
|
||||
ENV fprocess="/root/app"
|
||||
CMD ["fwatchdog"]
|
||||
|
9
sample-functions/WebhookStash/Dockerfile.build
Normal file
9
sample-functions/WebhookStash/Dockerfile.build
Normal file
@ -0,0 +1,9 @@
|
||||
FROM golang:1.7.5
|
||||
|
||||
RUN mkdir -p /go/src/app
|
||||
COPY handler.go /go/src/app
|
||||
WORKDIR /go/src/app
|
||||
RUN go get -d -v
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app .
|
||||
|
||||
CMD ["/bin/true"]
|
@ -1,3 +1,10 @@
|
||||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
echo Building functions/webhookstash:build
|
||||
|
||||
docker build -t alexellis2/faas-webhookstash .
|
||||
docker build --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -t functions/webhookstash:build . -f Dockerfile.build && \
|
||||
docker create --name hook_extract functions/webhookstash:build
|
||||
docker cp hook_extract:/go/src/app/app ./app
|
||||
docker rm -f hook_extract
|
||||
|
||||
echo Building functions/webhookstash:latest
|
||||
docker build --no-cache -t functions/webhookstash:latest .
|
||||
|
Reference in New Issue
Block a user