diff --git a/watchdog/.gitignore b/watchdog/.gitignore new file mode 100644 index 00000000..512d37b0 --- /dev/null +++ b/watchdog/.gitignore @@ -0,0 +1 @@ +fwatchdog diff --git a/watchdog/Dockerfile b/watchdog/Dockerfile index d55ad676..30ba1367 100644 --- a/watchdog/Dockerfile +++ b/watchdog/Dockerfile @@ -1,7 +1,9 @@ -FROM alpine:edge +FROM alpine:latest +ENTRYPOINT [] COPY ./fwatchdog /usr/bin/fwatchdog -ENV fprocess "cat -b" +ENV fprocess "cat" + EXPOSE 8080 -CMD ["fwatchdog"] +CMD ["/usr/bin/fwatchdog"] diff --git a/watchdog/Dockerfile.build b/watchdog/Dockerfile.build index b9ea1866..ea44643a 100644 --- a/watchdog/Dockerfile.build +++ b/watchdog/Dockerfile.build @@ -1,6 +1,6 @@ FROM golang:1.7.3 -RUN mkdir -p /go/src/fwatchdog -COPY main.go /go/src/fwatchdog -WORKDIR /go/src/fwatchdog +RUN mkdir -p /go/src/app +COPY main.go /go/src/app +WORKDIR /go/src/app RUN go get -d -v -RUN go build +RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app . diff --git a/watchdog/build.sh b/watchdog/build.sh index 76164212..bd4bd47b 100755 --- a/watchdog/build.sh +++ b/watchdog/build.sh @@ -2,6 +2,5 @@ docker build -t watchdog:latest . -f Dockerfile.build docker create --name buildoutput watchdog:latest -docker cp buildoutput:/go/src/fwatchdog/fwatchdog ./ +docker cp buildoutput:/go/src/app/app ./fwatchdog docker rm buildoutput -