-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile.paddle
83 lines (70 loc) · 2.45 KB
/
Dockerfile.paddle
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# FROM must be called before other ARGS except for ARG BASE_IMAGE
ARG BASE_IMAGE
FROM ${BASE_IMAGE}
# Customizable build arguments from cuda.yml
ARG DEVELOPER_BUILD
ARG CMAKE_VERSION
ARG PYTHON_VERSION
ARG BUILD_PADDLE_OPS
# Forward all ARG to ENV
# ci_utils.sh requires these environment variables
ENV DEVELOPER_BUILD=${DEVELOPER_BUILD}
ENV CMAKE_VERSION=${CMAKE_VERSION}
ENV PYTHON_VERSION=${PYTHON_VERSION}
ENV BUILD_PYTORCH_OPS=OFF
ENV BUILD_TENSORFLOW_OPS=OFF
ENV BUILD_PADDLE_OPS=${BUILD_PADDLE_OPS}
# Prevent interactive inputs when installing packages
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=America/Los_Angeles
ENV SUDO=command
# Miniconda requires bash as the default shell.
SHELL ["/bin/bash", "-c"]
# Dependencies: basic
RUN apt-get update && apt-get install -y \
git \
wget \
curl \
&& rm -rf /var/lib/apt/lists/*
# Dependencies: cmake
RUN CMAKE_VERSION_NUMBERS=$(echo "${CMAKE_VERSION}" | cut -d"-" -f2) \
&& wget -q https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION_NUMBERS}/${CMAKE_VERSION}.tar.gz \
&& tar -xf ${CMAKE_VERSION}.tar.gz \
&& cp -ar ${CMAKE_VERSION} ${HOME}
ENV PATH=${HOME}/${CMAKE_VERSION}/bin:${PATH}
# Dependencies: gcc
RUN rm /usr/bin/gcc && rm /usr/bin/g++ \
&& mv /usr/bin/gcc.bak /usr/bin/gcc \
&& mv /usr/bin/g++.bak /usr/bin/g++
ENV PATH=/usr/bin:${PATH}
# Miniconda
ENV PATH="/root/miniconda3/bin:${PATH}"
RUN wget -q https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \
&& bash Miniconda3-latest-Linux-x86_64.sh -b \
&& rm Miniconda3-latest-Linux-x86_64.sh \
&& conda --version
ENV PATH="/root/miniconda3/envs/open3d/bin:${PATH}"
RUN conda create -y -n open3d python=${PYTHON_VERSION} \
&& source activate open3d
RUN which python \
&& python --version
# Open3D C++ dependencies
# Done before copying the full Open3D directory for better Docker caching
COPY ./util/install_deps_ubuntu.sh /root/Open3D/util/
RUN /root/Open3D/util/install_deps_ubuntu.sh assume-yes \
&& rm -rf /var/lib/apt/lists/*
# Open3D Python dependencies
COPY ./util/ci_utils.sh /root/Open3D/util/
COPY ./python/requirements.txt /root/Open3D/python/
RUN source /root/Open3D/util/ci_utils.sh \
&& install_python_dependencies
# Open3D repo
# Always keep /root/Open3D as the WORKDIR
COPY . /root/Open3D
WORKDIR /root/Open3D
# Build python wheel
RUN export NPROC=$(nproc) \
&& export BUILD_SHARED_LIBS=OFF \
&& source /root/Open3D/util/ci_utils.sh \
&& build_pip_package build_azure_kinect
RUN echo "Docker build done."