4 ms·
Compiling Qt with Docker multi-stage and multi-platform
- gyre007 6y agoWe are finally getting closer to multi-arch builds with Docker buildx. It's annoying to jump the hoops when needing to do this for different things. buildx is changing that. Looking forward to having this capability in stable.
- mfontani 6y agoPlenty room for more (concurrent) layers, too! I've only recently embraced using multi-stage build to concurrently split a build in two to four steps * (one or more) fetcher, for fetching (say) the source package or cloning a git repo in the proper commit/branch, or having external dependencies whose output could be cached regardless of the rest of the dockerfile contents * builder, which uses "COPY --from=fetcher" to "bring over" the code or dependencies * the actual resulting image, which oftentimes could well be a "FROM scratch" and be just comprised of "COPY --from=builder" instructions. With "docker buildx", or with "DOCKER_BUILDKIT=1 docker build", it's pure joy to use!
- mvip 6y agoAuthor here. Yeah definitely. Hoping to tap into more of these features in the future.
- corytheboyd 6y agoNice, I too had started down this path when looking into using Docker for a new project of mine a few months back. Prior to that I had not really worked with Docker since ~2016 and damn multi-stage builds are a nice improvement. Not to mention how much more mature everything feels.
- c-smile 6y ago> Because compiling Qt (and QtWebEngine) is a very heavy operation, we would need to pre-compile and distribute Qt so that the Dockerfile could simply download and include it in the build process (rather than compiling as part of the installation process). Just in case: Release build of my Sciter.JS ( https://github.com/c-smile/sciter-js-sdk https://github.com/c-smile/sciter-js-sdk ) gets re-compiled in 55 seconds on pretty average dev machine that I have here. Sciter.JS is version of Sciter (https://sciter.com https://sciter.com) that uses JavaScript (ES6) script VM instead of custom TIScript. Sciter.JS covers functionality of Qt UI, Qt Quick and QtWebEngine. It already runs MithrilJS (micro-React), SvelteJS compilations, Leaflet (Maps) as they are. See: https://sciter.com/sciter-js-runs-leafletjs-as-it-is/ https://sciter.com/sciter-js-runs-leafletjs-as-it-is/ The end goal is to provide UI runtime that is in times smaller than Qt+QtWebEngine and ElectronJS but is still capable to run tons of existing Web components and frameworks.
- jcelerier 6y agoCan sciter expose methods & members of C++ classes to JS automatically ?
- c-smile 6y agoYes. Check SQLite wrapper, used either statically linked library or a DLL. You can use C++ classes as they are, just need advertisement, SOM_PASSPORT_BEGIN/END : https://github.com/c-smile/sciter-js-sdk/blob/main/sqlite/sciter-sqlite.h#L27 https://github.com/c-smile/sciter-js-sdk/blob/main/sqlite/sc...
- mixedCase 6y ago> Just in case: Release build of my Sciter.JS ( https://github.com/c-smile/sciter-js-sdk https://github.com/c-smile/sciter-js-sdk ) gets re-compiled in 55 seconds on pretty average dev machine that I have here. Does that repo include all that's needed? Meaning, Sciter.JS is fully open source as the LICENSE file indicates and requires no proprietary bits?
- c-smile 6y ago> Does that repo include all that's needed? Depends on what you really needed. The SDK includes everything that is needed to use Sciter in your apps. If you need its sources for whatever reason then you can request access to its sources (for now it is subject of NDA signing). As of commercial licenses - the price is a fraction of Qt price.
- varajelle 6y agoCompiling QtWebEngine is slow because it includes Chromium. And you did not include that in your 55s, did you?
- c-smile 6y agoSciter does not use WebKit - it is HTML/CSS/script engine by its own - implements essential parts of HTML5 and CSS needed to run desktop applications and popular web components and frameworks.
- mdaniel 6y ago<!-- wp:paragraph --> <p>RUN mkdir -p /sysroot/usr /sysroot/opt /sysroot/lib</p> it seems that article's formatting is having some issues