cleanup dockerfile
Signed-off-by: Martin Buchleitner <mabunixda@gmail.com>
This commit is contained in:
parent
4960ab3928
commit
4540686d70
19
Dockerfile
19
Dockerfile
|
|
@ -1,10 +1,12 @@
|
||||||
|
#
|
||||||
|
# building static go binary with golang container
|
||||||
|
#
|
||||||
FROM golang:stretch as builder
|
FROM golang:stretch as builder
|
||||||
|
|
||||||
RUN mkdir -p $GOPATH/pkg/mod $GOPATH/bin
|
RUN mkdir -p $GOPATH/pkg/mod $GOPATH/bin
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y ruby ruby-dev curl \
|
&& apt-get install -y curl \
|
||||||
&& gem install --no-document fpm \
|
|
||||||
&& curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh \
|
&& curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh \
|
||||||
&& mkdir -p $GOPATH/src/github.com/davidnewhall
|
&& mkdir -p $GOPATH/src/github.com/davidnewhall
|
||||||
|
|
||||||
|
|
@ -12,14 +14,21 @@ COPY . $GOPATH/src/github.com/davidnewhall/unifi-poller
|
||||||
WORKDIR $GOPATH/src/github.com/davidnewhall/unifi-poller
|
WORKDIR $GOPATH/src/github.com/davidnewhall/unifi-poller
|
||||||
|
|
||||||
RUN dep ensure \
|
RUN dep ensure \
|
||||||
&& CGO_ENABLED=0 make build
|
&& CGO_ENABLED=0 make linux
|
||||||
|
|
||||||
|
#
|
||||||
|
# creating container for run
|
||||||
|
# to use this container use the following command:
|
||||||
|
#
|
||||||
|
# docker run -d -v /your/config/up.conf:/etc/unifi-poller/up.conf golift/unifi-poller
|
||||||
|
#
|
||||||
|
# by using "-e UNIFI_PASSWORD=your-secret-pasword" you can avoid this configuration in the config file
|
||||||
|
#
|
||||||
FROM scratch
|
FROM scratch
|
||||||
|
|
||||||
COPY --from=builder /go/src/github.com/davidnewhall/unifi-poller/unifi-poller /unifi-poller
|
COPY --from=builder /go/src/github.com/davidnewhall/unifi-poller/unifi-poller.linux /unifi-poller
|
||||||
COPY --from=builder /go/src/github.com/davidnewhall/unifi-poller/examples/up.conf.example /etc/unifi-poller/up.conf
|
COPY --from=builder /go/src/github.com/davidnewhall/unifi-poller/examples/up.conf.example /etc/unifi-poller/up.conf
|
||||||
|
|
||||||
VOLUME [ "/etc/unifi-poller"]
|
VOLUME [ "/etc/unifi-poller"]
|
||||||
|
|
||||||
ENTRYPOINT [ "/unifi-poller" ]
|
ENTRYPOINT [ "/unifi-poller" ]
|
||||||
CMD [ "--config=/etc/unifi-poller/up.conf" ]
|
|
||||||
Loading…
Reference in New Issue