Skip to content

Commit

Permalink
Updated ubuntu-dep-src/Dockerfile to get the latest tag of the third …
Browse files Browse the repository at this point in the history
…parties, as done in the github CI
  • Loading branch information
LAGNEAU Romain committed Jul 4, 2024
1 parent 2580c2d commit 70ee887
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions ci/docker/ubuntu-dep-src/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ RUN ["/bin/bash", "-c", ": ${GIT_URL:?Build argument GIT_URL needs to be set and
ENV GIT_URL="$GIT_URL"
ENV GIT_BRANCH_CMD="${GIT_BRANCH_NAME}"
ENV GIT_BRANCH_CMD=${GIT_BRANCH_CMD:+"--branch $GIT_BRANCH_NAME --depth 1"}
ENV FUNCTION_GET_LATEST='git -c "versionsort.suffix=-" ls-remote --exit-code --refs --sort="version:refname" --tags ${GIT_ADDRESS} "*.*.*" | cut --delimiter="/" --fields=3 | grep -v -e pr | tail --lines=1'

# Update aptitude with default packages
RUN apt-get update \
Expand Down Expand Up @@ -62,7 +63,7 @@ RUN locale-gen en_US en_US.UTF-8 && \
update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 && \
export LANG=en_US.UTF-8

ENV USERNAME vispci
ENV USERNAME=vispci

RUN useradd -U --uid $USER_UID -ms /bin/bash ${USERNAME} \
&& echo "${USERNAME}:${USERNAME}" | chpasswd \
Expand All @@ -77,14 +78,16 @@ USER ${USERNAME}
WORKDIR /home/$USERNAME

# Some apps don't show controls without this
ENV QT_X11_NO_MITSHM 1
ENV QT_X11_NO_MITSHM=1

# Create folder for 3rd parties
RUN mkdir -p ${HOME}/visp-ws/3rdparty

# Install OpenBLAS from source
RUN cd ${HOME}/visp-ws/3rdparty \
&& git clone --depth 1 https://github.com/xianyi/OpenBLAS.git \
&& GIT_ADDRESS="https://github.com/xianyi/OpenBLAS.git" \
&& LATEST_TAG=`eval $FUNCTION_GET_LATEST` \
&& git clone --depth 1 --branch $LATEST_TAG $GIT_ADDRESS \
&& cd OpenBLAS \
&& mkdir install \
&& make -j$(nproc) \
Expand All @@ -95,7 +98,9 @@ ENV OpenBLAS_HOME=/3rdparty/OpenBLAS/install
# Install VTK from source
ENV GIT_CLONE_PROTECTION_ACTIVE=false
RUN cd ${HOME}/visp-ws/3rdparty \
&& git clone --recursive --depth 1 --branch v9.3.0 https://github.com/Kitware/VTK.git \
&& GIT_ADDRESS="https://github.com/Kitware/VTK.git" \
&& LATEST_TAG=`eval $FUNCTION_GET_LATEST` \
&& git clone --recursive --depth 1 --branch $LATEST_TAG $GIT_ADDRESS \
&& cd VTK \
&& mkdir build && cd build && mkdir install \
&& cmake .. -DVTK_ANDROID_BUILD=OFF -DVTK_BUILD_DOCUMENTATION=OFF -DVTK_BUILD_EXAMPLES=OFF -DVTK_BUILD_EXAMPLES=OFF \
Expand All @@ -107,7 +112,9 @@ ENV VTK_DIR=${HOME}/visp-ws/3rdparty/VTK/build/install

# Install OpenCV from source
RUN cd ${HOME}/visp-ws/3rdparty \
&& git clone --depth 1 https://github.com/opencv/opencv.git \
&& GIT_ADDRESS="https://github.com/opencv/opencv.git" \
&& LATEST_TAG=`eval $FUNCTION_GET_LATEST` \
&& git clone --depth 1 --branch $LATEST_TAG $GIT_ADDRESS \
&& mkdir opencv/build \
&& cd opencv/build \
&& mkdir install \
Expand All @@ -119,7 +126,9 @@ ENV OpenCV_DIR=${HOME}/visp-ws/3rdparty/opencv/build/install

# Install Intel® RealSense™ SDK
RUN cd ${HOME}/visp-ws/3rdparty \
&& git clone --depth 1 https://github.com/IntelRealSense/librealsense.git \
&& GIT_ADDRESS="https://github.com/IntelRealSense/librealsense.git" \
&& LATEST_TAG=`eval $FUNCTION_GET_LATEST` \
&& git clone --depth 1 --branch $LATEST_TAG $GIT_ADDRESS \
&& mkdir librealsense/build \
&& cd librealsense/build \
&& mkdir install \
Expand All @@ -131,7 +140,9 @@ ENV REALSENSE2_DIR=${HOME}/visp-ws/3rdparty/librealsense/build/install

# Build PCL from source
RUN cd ${HOME}/visp-ws/3rdparty \
&& git clone --depth 1 https://github.com/PointCloudLibrary/pcl.git \
&& GIT_ADDRESS="https://github.com/PointCloudLibrary/pcl.git" \
&& LATEST_TAG=`eval $FUNCTION_GET_LATEST` \
&& git clone --depth 1 --branch $LATEST_TAG $GIT_ADDRESS \
&& mkdir pcl/build \
&& cd pcl/build \
&& mkdir install \
Expand Down

0 comments on commit 70ee887

Please sign in to comment.