-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile_base
45 lines (35 loc) · 1.54 KB
/
Dockerfile_base
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
FROM ubuntu:18.04
# install dependencies
RUN apt-get update
ENV DEBIAN_FRONTEND="noninteractive" TZ="Asia/Kolkata"
RUN apt-get install -y libopencv-dev liblinear-dev libsvm-dev libtiff5-dev
RUN apt-get install -y build-essential checkinstall wget git python3-dev python3-numpy sudo
WORKDIR /opt
RUN wget -O - https://github.com/Kitware/CMake/releases/download/v3.20.2/cmake-3.20.2-linux-x86_64.tar.gz | tar -xzvf - && ln -s cmake-3.20.2-linux-x86_64 cmake
ENV PATH "/opt/cmake/bin:$PATH"
RUN apt-get -y install pkg-config zip g++ zlib1g-dev unzip python
# Use https://github.com/FloopCZ/tensorflow_cc to build and install tensorflow_cc
# Install bazel
ARG BAZEL_VERSION=3.7.2
ARG bazel_installer=bazel-${BAZEL_VERSION}-installer-linux-x86_64.sh
RUN wget -P /tmp https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/${bazel_installer}
RUN chmod +x /tmp/${bazel_installer}
RUN /tmp/${bazel_installer}
RUN rm /tmp/${bazel_installer}
# Build and install tensorflow_cc.so library
WORKDIR /opt
RUN git clone https://github.com/FloopCZ/tensorflow_cc.git
WORKDIR /opt/tensorflow_cc/tensorflow_cc
RUN mkdir build && cd build && cmake .. && make && make install
# cleanup bazel build directory
RUN rm -rf ~/.cache
# remove the build folder
RUN rm -rf /opt/tensorflow_cc
# Get Protocol buffers
WORKDIR /opt
RUN wget -c https://github.com/protocolbuffers/protobuf/releases/download/v3.9.2/protobuf-all-3.9.2.tar.gz && \
tar xvf protobuf-all-3.9.2.tar.gz && cd protobuf-3.9.2/ && \
./configure && \
make && \
make install
WORKDIR /home/ocr