This project builds Docker images with QtCreator and various compilers used to build and debug C++ and Gui applications using WSL and Docker.
Image (latest versions) | Size |
---|---|
Prerequiste: X server (Win11 or VcXsrv)
docker run -it \
-e DISPLAY=host.docker.internal:0 \
--mount src="$(pwd)",target=/build,type=bind \
arbmind/qtcreator-gcc-qt:latest \
qtcreator myproject.qbs
docker run -it \
-e DISPLAY=host.docker.internal:0 \
--mount src="$(pwd)",target=/build,type=bind \
arbmind/qtcreator-clang-libstdcpp-qt:latest \
qtcreator myproject.qbs
Description:
- define the display variable to use Docker
- mount the current directory to the
/build
folder - use the
qtcreator-clang-qt
image in the latest variant - start the qtcreator with
myproject.qbs
If you want to do more work on the project, we recommend to use a docker-compose.
version: "3.7"
volumes:
tmp: # cached builds
services:
myproject:
image: arbmind/qtcreator-gcc-qt:latest
environment:
- DISPLAY=host.docker.internal:0
command: qtcreator myproject.qbs
volumes:
- ./repository/:/build
- tmp:/tmp
The Dockerfile is multi staged and has different targets for all the variants. All targets with underscores are meant to be internally only.
Note: The Clang Qt combination is missing because the Qt Company does not publish binaries built for libc++
QtCreator is preconfigured to run Gui applications properly.
To support your development the user is non-root. You may still install extra software with sudo if you need.