mirror of
https://github.com/openfaas/faas.git
synced 2025-06-28 01:33:24 +00:00
Update to support docker stack deploy
This commit is contained in:
@ -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
16
gateway/Dockerfile.build
Normal 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 .
|
@ -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 .
|
||||
|
Reference in New Issue
Block a user