Skip to content

Commit a8dd0b9

Browse files
authored
Install tensorflow runtime (#9)
This patch installs tensorflow runtime to docker image.
1 parent 4615f91 commit a8dd0b9

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

Dockerfile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,30 @@
1-
ARG GOVERSION=1.12
1+
ARG GOVERSION=1.14
22

33
FROM golang:${GOVERSION}-buster
44

55
# All args after each FROM command are no longer available.
66
ARG COREDNSVERSION=v1.6.4
7+
ARG TENSORFLOWVERSION=1.15.0
78

89
RUN apt-get update && apt-get -uy upgrade
910
RUN apt-get -y install ca-certificates && update-ca-certificates
1011

1112
ENV COREDNSPATH github.com/coredns/coredns
1213
ENV DNSTUNPATH github.com/netrack/dnstun
14+
ENV TENSORFLOWPATH storage.googleapis.com/tensorflow/libtensorflow
1315
ENV GO111MODULE on
14-
ENV CGO_ENABLED 0
1516

1617
RUN curl -fsSL https://${COREDNSPATH}/archive/${COREDNSVERSION}.tar.gz -o coredns.tar.gz \
1718
&& mkdir -p coredns \
1819
&& tar -xzf coredns.tar.gz --strip-components=1 -C coredns \
1920
&& rm -rf coredns.tar.gz
2021

22+
23+
RUN curl -fsSL https://${TENSORFLOWPATH}/libtensorflow-cpu-linux-x86_64-${TENSORFLOWVERSION}.tar.gz -o tensorflow.tar.gz \
24+
&& tar -xzf tensorflow.tar.gz -C /usr/ \
25+
&& rm -rf tensorflow.tar.gz \
26+
&& ldconfig
27+
2128
COPY . ${GOPATH}/src/${DNSTUNPATH}
2229
COPY plugin.cfg coredns/plugin.cfg
2330

@@ -29,8 +36,9 @@ RUN go mod edit -replace ${DNSTUNPATH}@v0.0.0=${GOPATH}/src/${DNSTUNPATH}
2936
RUN go generate && go build -o /bin/coredns
3037

3138

32-
FROM scratch
39+
FROM debian:buster-slim
3340
COPY --from=0 /etc/ssl/certs /etc/ssl/certs
41+
COPY --from=0 /usr/lib/libtensorflow* /usr/lib/
3442
COPY --from=0 /bin/coredns /bin/coredns
3543
COPY Corefile /etc/coredns/Corefile
3644
VOLUME /etc/coredns

0 commit comments

Comments
 (0)