-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
113 lines (96 loc) · 3.56 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
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# FROM isaac_ros_dev-aarch64
# FROM ros:humble
FROM nvidia/cuda:11.8.0-runtime-ubuntu22.04
ENV DEBIAN_FRONTEND=noninteractive
ARG CONDA_VER=latest
ARG OS_TYPE=x86_64
SHELL ["/bin/bash", "-c"]
# uodate and install dependencies
RUN apt-get update && apt-get install -y -qq --no-install-recommends \
libyaml-cpp-dev \
# libboost-all-dev\
cmake-qt-gui \
libglvnd-dev \
libgl1-mesa-dev \
libegl1-mesa-dev \
libgles2-mesa-dev \
libxext6 \
libx11-6 \
freeglut3-dev \
git \
python3-pip \
python3-tk \
curl \
vim \
libcgal-dev \
libcgal-demo \
python-is-python3 \
build-essential \
cmake \
libeigen3-dev \
python3-dev \
libglm-dev \
wget \
ninja-build \
&& rm -rf /var/lib/apt/lists/*
# Install Miniconda
RUN wget https://github.com/conda-forge/miniforge/releases/${CONDA_VER}/download/Miniforge3-Linux-${OS_TYPE}.sh -O ~/miniconda.sh \
&& /bin/bash ~/miniconda.sh -b -p /opt/conda \
&& rm ~/miniconda.sh \
&& ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh \
&& echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc \
&& echo "conda activate base" >> ~/.bashrc
ENV PATH /opt/conda/bin:$PATH
SHELL ["conda", "run", "-n", "base", "/bin/bash", "-c"]
ENV CONDA_PREFIX /opt/conda
ENV CYCLONEDDS_HOME $CONDA_PREFIX
# Install the dependencies
# pinocchio and crocoddyl
RUN conda install -y -c conda-forge \
pinocchio \
crocoddyl
RUN conda install -c menpo opencv \
&& conda clean -afy
RUN pip install mujoco \
pyyaml \
matplotlib \
rerun-sdk \
opencv-python \
opencv-contrib-python
RUN conda install conda-forge::cxx-compiler
RUN conda install -c conda-forge cmake
# # CycloneDDS
WORKDIR /root
RUN git clone https://github.com/eclipse-cyclonedds/cyclonedds && \
cd cyclonedds && mkdir build install && cd build && \
cmake .. -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX && \
cmake --build . --config RelWithDebInfo --target install
RUN echo "export CYCLONEDDS_HOME=$CONDA_PREFIX" >> ~/.bashrc
RUN pip3 install git+https://github.com/eclipse-cyclonedds/cyclonedds-python
# CycloneDDS-cxx
WORKDIR /root
RUN git clone https://github.com/eclipse-cyclonedds/cyclonedds-cxx &&\
cd cyclonedds-cxx && mkdir build install && cd build && \
cmake -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
-DCMAKE_PREFIX_PATH=$CONDA_PREFIX .. && \
cmake --build . --target install
# Flexiv SDK
WORKDIR /root
RUN git clone https://github.com/flexivrobotics/flexiv_rdk && cd flexiv_rdk/thirdparty && \
bash build_and_install_dependencies.sh $CONDA_PREFIX && \
cd .. && mkdir build && cd build && \
cmake .. -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DINSTALL_PYTHON_RDK=OFF && \
cmake --build . --target install --config Release
# Install the FlexivPy bridge
COPY FlexivPy/cpp /root/flexivpy_bridge
WORKDIR /root/flexivpy_bridge
# if the source directory on the host system contains a build directory, delete it in the container
RUN ( [ -d "build" ] && rm -rf "build" ) || true
RUN mkdir build && cd build && cmake .. -DCMAKE_PREFIX_PATH=$CONDA_PREFIX \
&& make -j4 && make install
RUN echo export "export PATH=$PATH:/root/flexivpy_bridge/build" >> ~/.bashrc
RUN echo export "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/conda/lib" >> ~/.bashrc
# Env vars for the nvidia-container-runtime
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES graphics,utility,compute
ENTRYPOINT [ "/bin/bash", "-l", "-c" ]