Dockerfile.runtime_template 2.3 KB
Newer Older
W
wangjiawei04 已提交
1 2 3 4 5 6 7 8
# Dockerfile template
FROM <<base_image>>

RUN apt-get update && \
    apt-get install -y make build-essential

RUN apt-get update && \
    apt-get install -y wget tar xz-utils bzip2  libcurl4-openssl-dev \
9
    curl sed grep zlib1g-dev  libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev && \
W
wangjiawei04 已提交
10 11 12
    apt-get clean -y

WORKDIR /usr/bin
13
      COPY tools/dockerfiles/build_scripts /build_scripts
W
wangjiawei04 已提交
14 15 16 17 18 19 20 21 22 23
      RUN bash /build_scripts/install_gcc.sh gcc82 && rm -rf /build_scripts
      RUN cp gcc gcc.bak && cp g++ g++.bak && rm gcc && rm g++
      RUN ln -s /usr/local/gcc-8.2/bin/gcc /usr/local/bin/gcc
      RUN ln -s /usr/local/gcc-8.2/bin/g++ /usr/local/bin/g++
      RUN ln -s /usr/local/gcc-8.2/bin/gcc /usr/bin/gcc
      RUN ln -s /usr/local/gcc-8.2/bin/g++ /usr/bin/g++
      ENV PATH=/usr/local/gcc-8.2/bin:$PATH

# install python
WORKDIR /home
24
      COPY tools/dockerfiles/build_scripts /build_scripts
W
wangjiawei04 已提交
25 26 27 28 29
      RUN bash /build_scripts/install_python.sh <<python_version>> && rm -rf /build_scripts
      # Other 

# install whl and bin
WORKDIR /home
30
      COPY tools/dockerfiles/build_scripts /build_scripts
B
bjjwwang 已提交
31
      RUN bash /build_scripts/install_whl.sh <<serving_version>> <<paddle_version>> <<run_env>> <<python_version>> && rm -rf /build_scripts
W
wangjiawei04 已提交
32 33 34

# install tensorrt
WORKDIR /home
35
      COPY tools/dockerfiles/build_scripts /build_scripts
B
fix trt  
bjjwwang 已提交
36
      RUN bash /build_scripts/install_trt.sh <<run_env>> && rm -rf /build_scripts
W
wangjiawei04 已提交
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56

# install go
RUN wget -qO- https://dl.google.com/go/go1.14.linux-amd64.tar.gz | \
    tar -xz -C /usr/local && \
    mkdir /root/go && \
    mkdir /root/go/bin && \
    mkdir /root/go/src && \
    echo "GOROOT=/usr/local/go" >> /root/.bashrc && \
    echo "GOPATH=/root/go" >> /root/.bashrc && \
    echo "PATH=/usr/local/go/bin:/root/go/bin:$PATH" >> /root/.bashrc

RUN wget https://paddle-serving.bj.bcebos.com/others/centos_ssl.tar && \
    tar xf centos_ssl.tar && rm -rf centos_ssl.tar && \
    mv libcrypto.so.1.0.2k /usr/lib/libcrypto.so.1.0.2k && mv libssl.so.1.0.2k /usr/lib/libssl.so.1.0.2k && \
    ln -sf /usr/lib/libcrypto.so.1.0.2k /usr/lib/libcrypto.so.10 && \
    ln -sf /usr/lib/libssl.so.1.0.2k /usr/lib/libssl.so.10 && \
    ln -sf /usr/lib/libcrypto.so.10 /usr/lib/libcrypto.so && \
    ln -sf /usr/lib/libssl.so.10 /usr/lib/libssl.so

EXPOSE 22