forked from rai-project/tensorflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
53 lines (43 loc) · 2.06 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
FROM c3sr/base:amd64-cpu-go1.15-latest
# Build-time metadata as defined at http://label-schema.org
ARG BUILD_DATE
ARG VCS_REF
ARG VCS_URL
ARG VERSION
ARG ARCH
ARG TENSORFLOW_VERSION
LABEL org.carml.tensorflow.build-date=$BUILD_DATE \
org.carml.tensorflow.name="tensorflow agent" \
org.carml.tensorflow.description="" \
org.carml.tensorflow.url="https://mlmodelscope.org/" \
org.carml.tensorflow.vcs-ref=$VCS_REF \
org.carml.tensorflow.vcs-url=$VCS_URL \
org.carml.tensorflow.vendor="MLModelScope" \
org.carml.tensorflow.arch=$ARCH \
org.carml.tensorflow.version=$VERSION \
org.carml.tensorflow.framework_version=$TENSORFLOW_VERSION \
org.carml.tensorflow.schema-version="1.0"
# install Tensorflow for C
RUN wget https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-1.14.0.tar.gz && \
mkdir -p ${FRAMEWORKS_DIR}/tensorflow && \
tar -C ${FRAMEWORKS_DIR}/tensorflow -xzf libtensorflow-cpu-linux-x86_64-1.14.0.tar.gz && \
rm libtensorflow-cpu-linux-x86_64-1.14.0.tar.gz
ENV CGO_CFLAGS="${CGO_CFLAGS} -I ${FRAMEWORKS_DIR}/tensorflow/include"
ENV CGO_CXXFLAGS="${CGO_CXXFLAGS} -I ${FRAMEWORKS_DIR}/tensorflow/include"
ENV CGO_LDFLAGS="${CGO_LDFLAGS} -L ${FRAMEWORKS_DIR}/tensorflow/lib"
ENV LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${FRAMEWORKS_DIR}/tensorflow/lib
ENV PKG github.com/c3sr/tensorflow
RUN wget https://bootstrap.pypa.io/pip/3.6/get-pip.py && python3 get-pip.py && pip3 install opencv-python==4.2.0.32 && pip3 install numpy && pip3 install scipy
# Make our go directory structure
RUN mkdir -p /go/src/github.com/c3sr/tensorflow
WORKDIR /go/src/github.com/c3sr/tensorflow
# Handle Go Depedencies and cache it as a layer
COPY go.* ./
#COPY dlframework/go.mod dlframework/
#COPY dldataset/go.mod dldataset/
RUN go mod download
# Get the rest of the project in
COPY . .
RUN cd tensorflow-agent && \
go install -a -tags=nogpu -installsuffix cgo -ldflags "-X ${PKG}/Version=${VERSION} -X ${PKG}/GitCommit=${VCS_REF} -X ${PKG}/BuildDate=${BUILD_DATE}"
CMD ["/go/bin/tensorflow-agent", "worker"]