Update to support docker stack deploy

This commit is contained in:
Alex Ellis
2017-01-09 13:24:42 +00:00
parent 78f751312e
commit eb0776e3a3
11 changed files with 121 additions and 31 deletions

View File

@ -1,19 +1,9 @@
from golang:1.7.3
FROM golang:1.7.3
RUN go get -d github.com/docker/docker/api/types \
&& go get -d github.com/docker/docker/api/types/filters \
&& go get -d github.com/docker/docker/api/types/swarm \
&& go get -d github.com/docker/docker/client \
&& go get github.com/gorilla/mux \
&& go get github.com/prometheus/client_golang/prometheus
COPY gateway .
WORKDIR /go/src/github.com/alexellis/faas/gateway
COPY metrics metrics
COPY server.go .
RUN find /go/src/github.com/alexellis/faas/gateway/
RUN go build
EXPOSE 8080
ENV http_proxy ""
ENV https_proxy ""
CMD ["./gateway"]

16
gateway/Dockerfile.build Normal file
View File

@ -0,0 +1,16 @@
FROM golang:1.7.3
RUN go get -d github.com/docker/docker/api/types \
&& go get -d github.com/docker/docker/api/types/filters \
&& go get -d github.com/docker/docker/api/types/swarm \
&& go get -d github.com/docker/docker/client \
&& go get github.com/gorilla/mux \
&& go get github.com/prometheus/client_golang/prometheus
WORKDIR /go/src/github.com/alexellis/faas/gateway
COPY metrics metrics
COPY server.go .
RUN find /go/src/github.com/alexellis/faas/gateway/
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app .

View File

@ -1,4 +1,13 @@
#!/bin/sh
echo Building server:latest
echo Building alexellis2/faas-gateway:build
docker build -t server .
docker build --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy \
-t alexellis2/faas-gateway:build . -f Dockerfile.build
docker create --name gateway_extract alexellis2/faas-gateway:build
docker cp gateway_extract:/go/src/github.com/alexellis/faas/gateway/app ./gateway
docker rm -f gateway_extract
echo Building alexellis2/faas-gateway:latest
docker build -t alexellis2/faas-gateway:latest .