-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.cuda
59 lines (47 loc) · 2.06 KB
/
Dockerfile.cuda
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
ARG CUDA="11.3.1"
ARG UBUNTU="20.04"
ARG OPENCV="4.5.2"
ARG ROS="noetic"
ARG ARCH=""
FROM thecanadianroot/opencv-cuda:ubuntu${UBUNTU}-cuda${CUDA}-opencv${OPENCV}${ARCH}-ros${ROS}
ARG BUILD_DATE
ARG VERSION
ARG SONIA_USER=sonia
ARG SONIA_UID=50000
ARG BASE_LIB_NAME=sonia_common
LABEL maintainer="[email protected]"
LABEL net.etsmtl.sonia-auv.base_lib.build-date=${BUILD_DATE}
LABEL net.etsmtl.sonia-auv.base_lib.version=${VERSION}
LABEL net.etsmtl.sonia-auv.base_lib.name=${BASE_LIB_NAME}
## COMMON ENV
ENV ROS_LANG_DISABLE=genlisp:geneus
ENV SONIA_USER=${SONIA_USER}
ENV SONIA_HOME=/home/${SONIA_USER}
ENV SONIA_UID=${SONIA_UID}
ENV ROS_WS_SETUP=/opt/ros/${ROS_DISTRO}/setup.bash
## ENV FOR BASE LIB
ENV BASE_LIB_WS=${SONIA_HOME}/base_lib_ws
ENV BASE_LIB_WS_SETUP=${BASE_LIB_WS}/devel/setup.bash
ENV BASE_LIB_NAME=${BASE_LIB_NAME}
ENV BASE_LIB_PATH=${BASE_LIB_WS}/src/${BASE_LIB_NAME}
ENV SCRIPT_DIR=${BASE_LIB_PATH}/scripts
ENV ENTRYPOINT_FILE=sonia_entrypoint.sh
## ADD EXTRA DEPENDENCIES (GIT and ROS Remote Debugging)
RUN apt update && apt install -y gdb libyaml-cpp-dev openssh-client ros-noetic-diagnostics libboost-python-dev sudo ninja-build
RUN rm -rf /var/lib/apt/lists/*
COPY scripts/${ENTRYPOINT_FILE} /entrypoint.sh
RUN chmod +x /entrypoint.sh
RUN useradd --uid ${SONIA_UID} --create-home ${SONIA_USER} -G sudo
RUN echo 'sonia:test' | chpasswd
## Adding support for vscode extension volume caching
RUN mkdir -p ${SONIA_HOME}/.vscode-server/extensions && chown -R ${SONIA_USER}: ${SONIA_HOME}/.vscode-server
WORKDIR ${BASE_LIB_WS}
RUN mkdir -p src
RUN export CMAKE_PREFIX_PATH=/usr/local:$CMAKE_PREFIX_PATH && export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
RUN cd src && git clone https://github.com/ros-perception/vision_opencv.git && cd vision_opencv && git checkout noetic
RUN cd src && git clone https://github.com/ros-perception/image_common.git && cd image_common && git checkout noetic-devel
COPY . ${BASE_LIB_PATH}
RUN bash -c "source ${ROS_WS_SETUP} && catkin_make --use-ninja"
RUN chown -R ${SONIA_USER}: ${BASE_LIB_WS}
ENTRYPOINT ["/entrypoint.sh"]
CMD ["bash"]