Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@
compile_commands.json

# Build directories
build*
dist*
build*/
dist*/
110 changes: 110 additions & 0 deletions docker/Dockerfile_rocky
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# Rocky Linux + Qt via aqtinstall
# Usage:
# docker build --build-arg QT_VERSION=6.11.1 -t rocky-qt .
# docker run --rm -it rocky-qt bash
#
# Override defaults at build time:
# --build-arg QT_VERSION=6.11.1
# --build-arg QT_ARCH=gcc_64
# --build-arg QT_MODULES="qtcharts qt3d qtshadertools"

ARG AVDEPS_VERSION=2026.03.30
ARG CUDA_VERSION=12.1.1
ARG ROCKY_VERSION=9
# FROM rockylinux:${ROCKY_VERSION}
# FROM nvidia/cuda:${CUDA_VERSION}-devel-rockylinux${ROCKY_VERSION}
FROM alicevision/alicevision-deps:${AVDEPS_VERSION}-rocky${ROCKY_VERSION}-cuda${CUDA_VERSION}

# ── System dependencies ────────────────────────────────────────────────────────
# CRB (CodeReady Builder) is required for several *-devel packages
# RUN dnf -y update
RUN dnf -y install epel-release && \
dnf config-manager --set-enabled crb && \
Comment on lines +21 to +22

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The dnf config-manager command requires dnf-plugins-core to be installed. If it is not pre-installed in the base image, this step will fail. It is safer to explicitly install dnf-plugins-core before running dnf config-manager.

RUN dnf -y install epel-release dnf-plugins-core && \
    dnf config-manager --set-enabled crb && \

dnf -y groupinstall "Development Tools" && \
dnf -y install \
# Python / pip (needed by aqtinstall)
python3 \
python3-pip \
# Qt runtime / build dependencies
mesa-libGL-devel \
mesa-libEGL-devel \
libxkbcommon-devel \
libxkbcommon-x11 \
fontconfig-devel \
freetype-devel \
libX11-devel \
libXext-devel \
libXrender-devel \
libxcb-devel \
xcb-util-renderutil-devel \
xcb-util-image-devel \
xcb-util-cursor \
xcb-util-keysyms \
libXi-devel \
libXcomposite-devel \
libXcursor-devel \
libXdamage-devel \
libXfixes-devel \
libXrandr-devel \
libXtst-devel \
dbus-devel \
glib2-devel \
wayland-devel \
# CMake & Ninja for building Qt projects
cmake \
ninja-build \
# Misc utilities
wget \
git \
&& dnf clean all

# ── Install aqtinstall ─────────────────────────────────────────────────────────
RUN pip3 install --upgrade pip && \
pip3 install aqtinstall
Comment on lines +62 to +63

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

When installing Python packages via pip in a Dockerfile, it is best practice to use the --no-cache-dir flag to prevent caching package files, which unnecessarily increases the Docker image size.

RUN pip3 install --no-cache-dir --upgrade pip && \
    pip3 install --no-cache-dir aqtinstall


# ── Install Qt ────────────────────────────────────────────────────────────────

# List available versions
RUN aqt list-qt linux desktop

# List available modules
# RUN aqt list-qt linux desktop --modules "${QT_VERSION}" "${QT_ARCH}"

# ── Build arguments ────────────────────────────────────────────────────────────
ARG QT_VERSION=6.11.1
ARG QT_ARCH=linux_gcc_64
ARG QT_ARCH_SHORT=gcc_64
# A dependency of Qt requires qttasktree but not explicitely, so we need to force the installation.
ARG QT_MODULES="qtcharts qt3d qtshadertools qttasktree"
ARG QT_DIR=/opt/Qt

RUN if [ -n "${QT_MODULES}" ]; then \
aqt install-qt \
--outputdir "${QT_DIR}" \
linux desktop "${QT_VERSION}" "${QT_ARCH}" \
-m ${QT_MODULES}; \
else \
aqt install-qt \
--outputdir "${QT_DIR}" \
linux desktop "${QT_VERSION}" "${QT_ARCH}"; \
fi

# ── Environment variables ─────────────────────────────────────────────────────
ENV QT_ROOT="${QT_DIR}/${QT_VERSION}/${QT_ARCH_SHORT}"
ENV PATH="${QT_ROOT}/bin:${PATH}"
ENV LD_LIBRARY_PATH="${QT_ROOT}/lib:${LD_LIBRARY_PATH}"
ENV CMAKE_PREFIX_PATH="${QT_ROOT}"
ENV QT_PLUGIN_PATH="${QT_ROOT}/plugins"
ENV QML2_IMPORT_PATH="${QT_ROOT}/qml"
ENV QML_IMPORT_PATH="${QML2_IMPORT_PATH}"

# ── Smoke test ────────────────────────────────────────────────────────────────
RUN ls -l ${QT_ROOT}/lib
RUN find ${QT_DIR} -name "libQt6*.so*"
RUN echo "LD_LIBRARY_PATH: ${LD_LIBRARY_PATH}"
RUN ldd ${QT_ROOT}/bin/qmake

RUN qmake --version && cmake --version
Comment on lines +102 to +107

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Multiple sequential RUN instructions are used for smoke testing. Each RUN instruction creates a new layer in the Docker image. Combining these read-only commands into a single RUN instruction reduces the number of layers and keeps the image cleaner.

RUN ls -l ${QT_ROOT}/lib && \
    find ${QT_DIR} -name "libQt6*.so*" && \
    echo "LD_LIBRARY_PATH: ${LD_LIBRARY_PATH}" && \
    ldd ${QT_ROOT}/bin/qmake && \
    qmake --version && \
    cmake --version


WORKDIR /workspace
CMD ["bash"]
21 changes: 21 additions & 0 deletions docker/build-rocky.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
set -ex

Comment on lines +1 to +3

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To make the script robust and executable from any directory (e.g., the repository root), it is recommended to change the working directory to the script's directory at the beginning of the script.

Suggested change
#!/bin/bash
set -ex
#!/bin/bash
set -ex
# Ensure the script runs from its own directory
cd "$(dirname "$0")"

AVDEPS_VERSION=2026.03.30
ROCKY_VERSION=9
CUDA_VERSION=12.1.1
QT_VERSION=6.11.1 # 6.11.1 6.10.3 6.9.3 6.8.3

DOCKER_TAG=alicevision/qt-av-deps:qt${QT_VERSION}-avdeps${AVDEPS_VERSION}-rocky${ROCKY_VERSION}-cuda${CUDA_VERSION}

docker build \
--rm \
--progress=plain \
--build-arg "QT_VERSION=${QT_VERSION}" \
--tag "${DOCKER_TAG}" \
-f Dockerfile_rocky .
Comment on lines +11 to +16

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The script defines AVDEPS_VERSION, ROCKY_VERSION, and CUDA_VERSION and uses them to construct the DOCKER_TAG. However, these variables are not passed as --build-arg to the docker build command. As a result, the build will use the default values hardcoded in the Dockerfile_rocky, which can lead to a mismatch between the actual image contents and the generated tag if these variables are modified in this script.

Suggested change
docker build \
--rm \
--progress=plain \
--build-arg "QT_VERSION=${QT_VERSION}" \
--tag "${DOCKER_TAG}" \
-f Dockerfile_rocky .
docker build \
--rm \
--progress=plain \
--build-arg "AVDEPS_VERSION=${AVDEPS_VERSION}" \
--build-arg "ROCKY_VERSION=${ROCKY_VERSION}" \
--build-arg "CUDA_VERSION=${CUDA_VERSION}" \
--build-arg "QT_VERSION=${QT_VERSION}" \
--tag "${DOCKER_TAG}" \
-f Dockerfile_rocky .


echo "# To launch the docker image:"
echo docker run -it ${DOCKER_TAG} /bin/bash