Dockerfile to build Qt 6
You can pull a prebuilt Ubuntu 20.04 image with Qt 6 from Docker Hub:
sudo docker pull omergoktas/qt6docker
Based on the code (thanks to @wiktorguz)
-
Clone the repository:
git clone https://github.com/omergoktas/qt6docker cd qt6docker
-
Build the image:
sudo docker build --tag qt6docker .
-
or build the image with a specific Qt module (i.e., qtbase):
sudo docker build --build-arg QT_MODULE=qtbase --tag qt6docker .
-
or build the image with a specific version of Qt:
sudo docker build --build-arg QT_MAJ=6.1 --build-arg QT_MIN=1 --tag qt6docker .
-
or build the image with a specific Qt source:
sudo docker build --build-arg QT_SRC_URL="https://download.qt.io/development_releases/qt/6.5/6.5.0-beta2/submodules/qtbase-everywhere-src-6.5.0-beta2.tar.xz" --tag qt6docker .
-
or build the image with a specific version of Ubuntu:
sudo docker build --build-arg BASE_IMAGE=ubuntu:18.04 --tag qt6docker .
Note Qt 6.2.0+ requires Ubuntu 20.04+ to build successfully.