From a8dd0b9f0f05e9fb9c9829f823144b2ac564fcc1 Mon Sep 17 00:00:00 2001 From: Yasha Bubnov Date: Wed, 26 Feb 2020 21:29:18 +0300 Subject: [PATCH] Install tensorflow runtime (#9) This patch installs tensorflow runtime to docker image. --- Dockerfile | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 599eb97..3334919 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,23 +1,30 @@ -ARG GOVERSION=1.12 +ARG GOVERSION=1.14 FROM golang:${GOVERSION}-buster # All args after each FROM command are no longer available. ARG COREDNSVERSION=v1.6.4 +ARG TENSORFLOWVERSION=1.15.0 RUN apt-get update && apt-get -uy upgrade RUN apt-get -y install ca-certificates && update-ca-certificates ENV COREDNSPATH github.com/coredns/coredns ENV DNSTUNPATH github.com/netrack/dnstun +ENV TENSORFLOWPATH storage.googleapis.com/tensorflow/libtensorflow ENV GO111MODULE on -ENV CGO_ENABLED 0 RUN curl -fsSL https://${COREDNSPATH}/archive/${COREDNSVERSION}.tar.gz -o coredns.tar.gz \ && mkdir -p coredns \ && tar -xzf coredns.tar.gz --strip-components=1 -C coredns \ && rm -rf coredns.tar.gz + +RUN curl -fsSL https://${TENSORFLOWPATH}/libtensorflow-cpu-linux-x86_64-${TENSORFLOWVERSION}.tar.gz -o tensorflow.tar.gz \ + && tar -xzf tensorflow.tar.gz -C /usr/ \ + && rm -rf tensorflow.tar.gz \ + && ldconfig + COPY . ${GOPATH}/src/${DNSTUNPATH} COPY plugin.cfg coredns/plugin.cfg @@ -29,8 +36,9 @@ RUN go mod edit -replace ${DNSTUNPATH}@v0.0.0=${GOPATH}/src/${DNSTUNPATH} RUN go generate && go build -o /bin/coredns -FROM scratch +FROM debian:buster-slim COPY --from=0 /etc/ssl/certs /etc/ssl/certs +COPY --from=0 /usr/lib/libtensorflow* /usr/lib/ COPY --from=0 /bin/coredns /bin/coredns COPY Corefile /etc/coredns/Corefile VOLUME /etc/coredns