From 6cebb2e2d1049990aa1b67c6039e902c5c66742d Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Thu, 19 Dec 2024 11:38:01 +0100 Subject: [PATCH 1/2] Update docker files to user VISP_WS env var --- ci/docker/ubuntu-18.04/Dockerfile | 8 ++++---- ci/docker/ubuntu-20.04/Dockerfile | 10 +++++----- ci/docker/ubuntu-22.04/Dockerfile | 11 +++++++---- ci/docker/ubuntu-24.04/Dockerfile | 15 +++++++++------ 4 files changed, 25 insertions(+), 19 deletions(-) diff --git a/ci/docker/ubuntu-18.04/Dockerfile b/ci/docker/ubuntu-18.04/Dockerfile index 468a3cb008..46d007e0a8 100644 --- a/ci/docker/ubuntu-18.04/Dockerfile +++ b/ci/docker/ubuntu-18.04/Dockerfile @@ -67,7 +67,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 \ @@ -82,11 +82,11 @@ USER ${USERNAME} WORKDIR /home/$USERNAME # Create visp workspace -ENV VISP_WS /home/$USERNAME/visp-ws +ENV VISP_WS=/home/$USERNAME/visp-ws # Install visp-images -RUN mkdir -p ${HOME}/visp-ws \ - && cd ${HOME}/visp-ws \ +RUN mkdir -p ${VISP_WS} \ + && cd ${VISP_WS} \ && git clone https://github.com/lagadic/visp-images.git \ && echo "export VISP_WS=${HOME}/visp-ws" >> ${HOME}/.bashrc \ && echo "export VISP_INPUT_IMAGE_PATH=${HOME}/visp-ws/visp-images" >> ${HOME}/.bashrc diff --git a/ci/docker/ubuntu-20.04/Dockerfile b/ci/docker/ubuntu-20.04/Dockerfile index 3a20a67327..4cb0c9cb4b 100644 --- a/ci/docker/ubuntu-20.04/Dockerfile +++ b/ci/docker/ubuntu-20.04/Dockerfile @@ -68,7 +68,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 \ @@ -83,14 +83,14 @@ 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 visp workspace -ENV VISP_WS /home/$USERNAME/visp-ws +ENV VISP_WS=/home/$USERNAME/visp-ws # Install visp-images -RUN mkdir -p ${HOME}/visp-ws \ - && cd ${HOME}/visp-ws \ +RUN mkdir -p ${VISP_WS} \ + && cd ${VISP_WS} \ && git clone https://github.com/lagadic/visp-images.git \ && echo "export VISP_WS=${HOME}/visp-ws" >> ${HOME}/.bashrc \ && echo "export VISP_INPUT_IMAGE_PATH=${HOME}/visp-ws/visp-images" >> ${HOME}/.bashrc diff --git a/ci/docker/ubuntu-22.04/Dockerfile b/ci/docker/ubuntu-22.04/Dockerfile index e0a12e87fd..a51f581f7d 100644 --- a/ci/docker/ubuntu-22.04/Dockerfile +++ b/ci/docker/ubuntu-22.04/Dockerfile @@ -68,7 +68,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 \ @@ -83,11 +83,14 @@ 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 visp workspace +ENV VISP_WS=/home/$USERNAME/visp-ws # Install visp-images -RUN mkdir -p ${HOME}/visp-ws \ - && cd ${HOME}/visp-ws \ +RUN mkdir -p ${VISP_WS} \ + && cd ${VISP_WS} \ && git clone https://github.com/lagadic/visp-images.git \ && echo "export VISP_WS=${HOME}/visp-ws" >> ${HOME}/.bashrc \ && echo "export VISP_INPUT_IMAGE_PATH=${HOME}/visp-ws/visp-images" >> ${HOME}/.bashrc diff --git a/ci/docker/ubuntu-24.04/Dockerfile b/ci/docker/ubuntu-24.04/Dockerfile index 08b76e39db..503aa60cd7 100644 --- a/ci/docker/ubuntu-24.04/Dockerfile +++ b/ci/docker/ubuntu-24.04/Dockerfile @@ -68,7 +68,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 \ @@ -83,21 +83,24 @@ 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 visp workspace +ENV VISP_WS=/home/$USERNAME/visp-ws # Install visp-images -RUN mkdir -p ${HOME}/visp-ws \ - && cd ${HOME}/visp-ws \ +RUN mkdir -p ${VISP_WS} \ + && cd ${VISP_WS} \ && git clone https://github.com/lagadic/visp-images.git \ && echo "export VISP_WS=${HOME}/visp-ws" >> ${HOME}/.bashrc \ && echo "export VISP_INPUT_IMAGE_PATH=${HOME}/visp-ws/visp-images" >> ${HOME}/.bashrc # Get visp -RUN cd ${HOME}/visp-ws \ +RUN cd ${VISP_WS} \ && git clone https://github.com/lagadic/visp # Build visp -RUN cd ${HOME}/visp-ws \ +RUN cd ${VISP_WS} \ && mkdir visp-build \ && cd visp-build \ && cmake ../visp \ From 9901f928f88a4f1ac5922bc7683ce5a0104777ab Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Thu, 19 Dec 2024 11:38:40 +0100 Subject: [PATCH 2/2] Introduce Dockerfiles for old Ubuntu versions 14.04 and 16.04 --- ci/docker/ubuntu-14.04/Dockerfile | 103 +++++++++++++++++++++++++++ ci/docker/ubuntu-16.04/Dockerfile | 111 ++++++++++++++++++++++++++++++ 2 files changed, 214 insertions(+) create mode 100644 ci/docker/ubuntu-14.04/Dockerfile create mode 100644 ci/docker/ubuntu-16.04/Dockerfile diff --git a/ci/docker/ubuntu-14.04/Dockerfile b/ci/docker/ubuntu-14.04/Dockerfile new file mode 100644 index 0000000000..c9f5308b57 --- /dev/null +++ b/ci/docker/ubuntu-14.04/Dockerfile @@ -0,0 +1,103 @@ +FROM ubuntu:14.04 + +ARG DEBIAN_FRONTEND=noninteractive +ARG USER_UID=1001 +ENV TZ=Europe/Paris + +# Update aptitude with default packages +RUN apt-get update \ + && apt-get install -y \ + build-essential \ + cmake \ + cmake-curses-gui \ + curl \ + gedit \ + gdb \ + git \ + iputils-ping \ + locales \ + locate \ + lsb-release \ + nano \ + net-tools \ + software-properties-common \ + sudo \ + tzdata \ + vim \ + wget \ + && apt-get clean + +# Update aptitude with recommended ViSP 3rd parties +RUN apt-get update \ + && apt-get install -y \ + libdc1394-22-dev \ + libeigen3-dev \ + liblapack-dev \ + libopencv-dev \ + libv4l-dev \ + libx11-dev \ + libzbar-dev \ + && apt-get clean + +# Update aptitude with other optional ViSP 3rd parties +RUN apt-get update \ + && apt-get install -y \ + libcoin80-dev \ + libjpeg-dev \ + libpng-dev \ + libogre-1.9-dev \ + libois-dev \ + libdmtx-dev \ + && apt-get clean + +# Set Locale +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 + +RUN useradd -U --uid $USER_UID -ms /bin/bash ${USERNAME} \ + && echo "${USERNAME}:${USERNAME}" | chpasswd \ + && adduser ${USERNAME} sudo \ + && echo "$USERNAME ALL=NOPASSWD: ALL" >> /etc/sudoers.d/${USERNAME} \ + && adduser ${USERNAME} video + +# Commands below are now run as normal user +USER ${USERNAME} + +# When running a container start in the home folder +WORKDIR /home/$USERNAME + +# Create visp workspace +ENV VISP_WS=/home/$USERNAME/visp-ws + +# Install visp-images +RUN mkdir -p ${VISP_WS} \ + && cd ${VISP_WS} \ + && git clone https://github.com/lagadic/visp-images.git \ + && echo "export VISP_WS=${HOME}/visp-ws" >> ${HOME}/.bashrc \ + && echo "export VISP_INPUT_IMAGE_PATH=${HOME}/visp-ws/visp-images" >> ${HOME}/.bashrc + +# Download cmake 3.32.2 linux-x86_64 +RUN mkdir -p ${VISP_WS}/3rdparty/cmake \ + && cd ${VISP_WS}/3rdparty/cmake \ + && curl -SLO https://github.com/Kitware/CMake/archive/refs/tags/v3.10.0.tar.gz \ + && tar xvzf v3.10.0.tar.gz \ + && cd CMake-3.10.0 \ + && sh bootstrap --prefix=/usr \ + && make -j$(nproc) \ + && sudo make install + +# Get visp +RUN cd ${VISP_WS} \ + && git clone https://github.com/lagadic/visp + +# Build visp +RUN cd ${VISP_WS} \ + && mkdir visp-build \ + && cd visp-build \ + && cmake ../visp \ + && make -j$(nproc) + +CMD ["/bin/bash"] diff --git a/ci/docker/ubuntu-16.04/Dockerfile b/ci/docker/ubuntu-16.04/Dockerfile new file mode 100644 index 0000000000..26b182ab99 --- /dev/null +++ b/ci/docker/ubuntu-16.04/Dockerfile @@ -0,0 +1,111 @@ +FROM ubuntu:16.04 + +ARG DEBIAN_FRONTEND=noninteractive +ARG USER_UID=1001 +ENV TZ=Europe/Paris + +# Update aptitude with default packages +RUN apt-get update \ + && apt-get install -y \ + build-essential \ + cmake \ + cmake-curses-gui \ + curl \ + gedit \ + gdb \ + git \ + iputils-ping \ + locales \ + locate \ + lsb-release \ + mercurial \ + nano \ + net-tools \ + python3 \ + python3-dev \ + python3-pip \ + python3-dbg \ + python3-empy \ + python3-numpy \ + python3-pip \ + python3-psutil \ + python3-venv \ + software-properties-common \ + sudo \ + tzdata \ + vim \ + wget \ + && apt-get clean + +# Update aptitude with recommended ViSP 3rd parties +RUN apt-get update \ + && apt-get install -y \ + libdc1394-22-dev \ + libeigen3-dev \ + liblapack-dev \ + libopencv-dev \ + libv4l-dev \ + libx11-dev \ + libzbar-dev \ + && apt-get clean + +# Update aptitude with other optional ViSP 3rd parties +RUN apt-get update \ + && apt-get install -y \ + libpcl-dev \ + libcoin80-dev \ + libjpeg-dev \ + libpng-dev \ + libogre-1.9-dev \ + libois-dev \ + libdmtx-dev \ + libgsl-dev \ + && apt-get clean + +# Set Locale +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 + +RUN useradd -U --uid $USER_UID -ms /bin/bash ${USERNAME} \ + && echo "${USERNAME}:${USERNAME}" | chpasswd \ + && adduser ${USERNAME} sudo \ + && echo "$USERNAME ALL=NOPASSWD: ALL" >> /etc/sudoers.d/${USERNAME} \ + && adduser ${USERNAME} video + +# Commands below are now run as normal user +USER ${USERNAME} + +# When running a container start in the home folder +WORKDIR /home/$USERNAME + +# Create visp workspace +ENV VISP_WS=/home/$USERNAME/visp-ws + +# Install visp-images +RUN mkdir -p ${VISP_WS} \ + && cd ${VISP_WS} \ + && git clone https://github.com/lagadic/visp-images.git \ + && echo "export VISP_WS=${HOME}/visp-ws" >> ${HOME}/.bashrc \ + && echo "export VISP_INPUT_IMAGE_PATH=${HOME}/visp-ws/visp-images" >> ${HOME}/.bashrc + +# Download cmake 3.32.2 linux-x86_64 +RUN mkdir -p ${VISP_WS}/3rdparty/cmake \ + && cd ${VISP_WS}/3rdparty/cmake \ + && curl -SLO https://github.com/Kitware/CMake/releases/download/v3.31.2/cmake-3.31.2-linux-x86_64.sh \ + && sudo sh cmake-3.31.2-linux-x86_64.sh --prefix=/usr --skip-license + +# Get visp +RUN cd ${VISP_WS} \ + && git clone https://github.com/lagadic/visp + +# Build visp +RUN cd ${VISP_WS} \ + && mkdir visp-build \ + && cd visp-build \ + && cmake ../visp \ + && make -j$(nproc) + +CMD ["/bin/bash"]