GithubHelp home page GithubHelp logo

carlonluca / docker-qt Goto Github PK

View Code? Open in Web Editor NEW
33.0 4.0 7.0 1.19 MB

Collection of data to create docker images with Qt support.

License: GNU General Public License v3.0

Shell 79.06% CMake 1.38% Roff 19.43% C++ 0.13%
qt5 qt6 docker continuous-integration

docker-qt's Introduction

Intro

The repo contains the code needed to create docker images to build and crossbuild Qt 5 and 6 and to build and crossbuild Qt based apps. This is useful to create images for continuous integration or to build for embedded devices.

Articles with more info: https://bugfreeblog.duckdns.org/tag/docker-qt.

Summary of all available images with the included features: https://bugfreeblog.duckdns.org/docker-qt-tags.

docker Qt

gitlab CI

Qt can be built from the sources (this may need a lot of time) or can be downloaded from the Qt web server. Unfortuantely, Qt does not always keep all Qt versions, so it may not always be possible to download Qt, and rebuilding is the only chance.

Images

Images for some Qt versions are already available here:

The qt-builder is an image to be used to cross-build Qt itself for the available platforms. It includes all the headers and the libraries needed to build and crossbuild Qt from its sources. By using the build_* scripts, Qt tarballs are exported. The builder in docker hub is only built for the x64 architecture. The arm builds are all created by crosscompiling.

The qt-dev images are images that include prebuilt Qt installations. They include all the deps needed to build and run Qt apps. These images available for two archs in docker hub: the arm64 version only includes the arm64 build of Qt, the x64 version includes the x64 build and the Android builds. NOTE: not all these images are identical, but the Qt installation is typically in /opt.

Qt Builder

Before trying to build a Qt version, you'll need a proper builder image. The builder image includes all the deps needed to complete the build process. At the moment, I created two builders: one based on focal and one based on jammy. The one based on focal must be used to build Qt 5, the one based on jammy is used to build Qt 6.

Once the builder is available, you can use the builder to run the build of Qt itself. Refer to the build scripts at this point. Once the build script is done, you should find Qt packages available in the export directory. Those packages are used to create the dev images.

Qt Dev Image

Once packages are ready in the export directory you can build the dev image. Use the dockerfiles in the root directory to build this image, according to the examples below.

Images evolved in time. In this page I try to keep track of images and of what each immage support: https://bugfreeblog.duckdns.org/docker-qt-tags.

Qt 5

docker buildx build --push --platform linux/arm64/v8,linux/amd64 --build-arg QTVER=5.15.2 -t ... . -f Dockerfile_5.x .

Qt 6

docker buildx build --push --platform linux/arm64/v8,linux/amd64 --build-arg QTVER=6.1.2 -t ... -f Dockerfile_6.x .

docker-qt's People

Contributors

carlonluca avatar ramajd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

docker-qt's Issues

How to run

How to run carlonluca/qt-dev? when I use "docker run -it carlonluca/qt-dev:latest", the output of terminal is

โžœ  ~ docker run -it   carlonluca/qt-dev:latest 
/bin/bash: -c: option requires an argument

How does one inject and configure project into the image for compilation?

Hello, this might be a skill issue for sure, but I'm not super familiar with docker images - also If this isn't the right way to request help, feel free to laugh at me.

I have a project which I'd like to use (qmake based) referenced from a local linux system with an aarch64 + android tool chain of which I have no idea how was created. Ideally I would want to use this toolchain which I've build using the scripts to create a build for 5.15.10 as a basis to verify the code still produces artifacts, but also to then port it to 6.6.3.

It is unclear on what should be done here since the qmake project.pro.user files all reference the old qt installation paths and have the targets 'ie - amd64, aarch64, android pre-set'? Also I'm targeting Android 10 specifically for that deployment, and was wondering if there was a means to select that specific SDK, is that something that happens when building the builder image? I could usually figure this out with qtcreator, but that part isn't compiled in (or should need to be), curious if there are some other variables that would be required for such a feat.

My goal is to take the current qmake based project which has specific target names per arch, and have it build for all arch so I can pull the artifacts if that helps clear up anything, but you know, .user file -> mapping to those specific compilers/crosscompile chain.

It sounds... like I just need to look at my local dev from qtcreator to see what commands it is calling and redirect them to the /opt/Qt installation path, but I noticed the 6.6.3 is using symlinks around, so unsure if I need to alter the links, or if they work with every compiler definition for the project (like how creator would assign them)?

It is awesome that this image cross compiles for everything I would need, truly impressive.

Any help would be appreciated, or direction on what I should look at to figure it out, thanks :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.