Static binary

This commit is contained in:
Alex Ellis 2016-12-22 13:28:30 +00:00
parent 8fe7cb691d
commit a3cb54ab87
4 changed files with 11 additions and 9 deletions

1
watchdog/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
fwatchdog

View File

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

View File

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

View File

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