Make webhookstash a static binary

This commit is contained in:
Alex Ellis
2017-04-13 22:58:32 +01:00
parent 2575ef407d
commit ee95e272cc
6 changed files with 32 additions and 15 deletions

View File

@ -0,0 +1 @@
app

View File

@ -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"]

View 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"]

View File

@ -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 .