Skip to content

OlivierLDff/QtLinuxCMakeDocker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🐳 Qt Linux docker

🐳 Publish Docker image Docker

Ready to use environment to compile application using Qt/CMake and deploy AppImage.

  • Qt 5.15.2
  • CMake 3.29.0
  • GCC 9
  • linuxdeployqt

How to use

This image is made to build cmake qt project for linux, but it can also build qmake based.

⌨️ Interactive bash

You can run an interactive bash to build whatever you need. Execute this command from you source folder, to map it to /src folder in the container.

# This folder will be mounted in the container as /src
cd /path/to/my/project
# Start bash in the container
docker run -it --rm -v $(pwd):/src/ --device /dev/fuse --cap-add SYS_ADMIN --security-opt apparmor:unconfined reivilo1234/qt-linux-cmake:qt5.15.1 bash
# Then regular cmake workflow
mkdir -p build && cd build
cmake ..
make -j
# Build target will be available in /path/to/my/project/build

🚀 Run only commands inside container

# Everything need to be executed in the same folder as CMakeLists.txt
# This folder will be mounted in the container as /src
cd /path/to/my/project

# Customize here your build folder name
export BUILD_DIR=build
# Create alias to run a command in the container
alias docker-run='docker run --rm -v $(pwd):/src/ --device /dev/fuse --cap-add SYS_ADMIN --security-opt apparmor:unconfined reivilo1234/qt-linux-cmake:qt5.15.2'

# Create build directory in host
mkdir -p $BUILD_DIR
# Execute cmake in container
docker-run cmake -B ./$BUILD_DIR/ -S . ..
# Execute make in container
docker-run make -C $BUILD_DIR -j

🔨 How to build Docker Image

Run in the same directory as the Dockerfile

export DOCKER_TAG=qt5.15.1
docker build --tag qt-linux-cmake:$DOCKER_TAG .
docker tag qt-linux-cmake:$DOCKER_TAG reivilo1234/qt-linux-cmake:$DOCKER_TAG
docker push reivilo1234/qt-linux-cmake:$DOCKER_TAG