mirror of
https://github.com/jessfraz/dockerfiles.git
synced 2025-04-14 08:02:44 +02:00
fix firewall
This commit is contained in:
parent
4ef885c215
commit
a12781e0bb
firewall
@ -2,10 +2,7 @@ FROM golang:latest
|
|||||||
MAINTAINER Jessica Frazelle <jess@docker.com>
|
MAINTAINER Jessica Frazelle <jess@docker.com>
|
||||||
|
|
||||||
RUN go get github.com/Sirupsen/logrus
|
RUN go get github.com/Sirupsen/logrus
|
||||||
RUN go get github.com/coreos/go-etcd/etcd && \
|
RUN go get github.com/coreos/go-etcd/etcd
|
||||||
cd /go/src/github.com/coreos/go-etcd && \
|
|
||||||
git checkout 6654a8c3055c6154c3f9dfd78c852ada46a2bed0 && \
|
|
||||||
go install github.com/coreos/go-etcd/etcd
|
|
||||||
|
|
||||||
ADD ./main.go /src/main.go
|
ADD ./main.go /src/main.go
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/Sirupsen/logrus"
|
"github.com/Sirupsen/logrus"
|
||||||
"github.com/coreos/go-etcd/etcd"
|
"github.com/coreos/go-etcd/etcd"
|
||||||
@ -148,18 +147,10 @@ func main() {
|
|||||||
logger.Fatal(err)
|
logger.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// run in a loop incase we have network issues connecting to etcd
|
update := make(chan *etcd.Response)
|
||||||
for i := 0; i < 100; i++ {
|
go processLoop(client, update)
|
||||||
update := make(chan *etcd.Response, 10)
|
|
||||||
go processLoop(client, update)
|
|
||||||
|
|
||||||
if _, err := client.Watch("/firewall", 0, true, update, nil); err != nil {
|
if _, err := client.Watch("/firewall", 0, true, update, nil); err != nil {
|
||||||
logger.Error(err)
|
logger.Error(err)
|
||||||
}
|
|
||||||
close(update)
|
|
||||||
|
|
||||||
time.Sleep(10 * time.Second)
|
|
||||||
|
|
||||||
logger.Infof("restarting process loop %d times", i)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user