Skip to content

Commit

Permalink
Install tensorflow runtime (#9)
Browse files Browse the repository at this point in the history
This patch installs tensorflow runtime to docker image.
  • Loading branch information
ybubnov authored Feb 26, 2020
1 parent 4615f91 commit a8dd0b9
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
Expand Down

0 comments on commit a8dd0b9

Please sign in to comment.